Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download
Project: Peter's Files
Views: 64
Visibility: Unlisted (only visible to those who know the link)
Kernel: Python 3 (Ubuntu Linux)

What can you say about the number of non-zero terms in the sequence S((s1,,sn),f)=(s1,,sn,sn+1)S((s_{1},\dots, s_{n}),f)=(s_1,\dots,s_n,s_{n+1}\dots) where

si=(j=1i1sj)modf(i)s_{i}=\left(\prod_{j=1}^{i-1}s_j\right)\bmod f(i)

for a given s1,,sns_{1},\dots, s_{n} and function f:NNf:\mathbb{N}\to \mathbb{N}?

import numpy as np
def f(input): return input def maker(N): S = np.array([*N]) i=len(S)+1 while np.array([np.prod(S) % f(i) ]) != 0: S = np.concatenate((S,np.array([np.prod(S) % f(i) ]))) i = i + 1 if i == 100: return np.concatenate((S, np.array([99999999]))) return np.concatenate((S,np.array([0])))
for k in np.arange(3,100): print(f'S(({k}),0)={maker((k,))}')
S((3),0)=[3 1 0] S((4),0)=[4 0] S((5),0)=[5 1 2 2 0] S((6),0)=[6 0] S((7),0)=[7 1 1 3 1 3 0] S((8),0)=[8 0] S((9),0)=[9 1 0] S((10),0)=[10 0] S((11),0)=[11 1 2 2 4 2 2 0] S((12),0)=[12 0] S((13),0)=[13 1 1 1 3 3 5 1 0] S((14),0)=[14 0] S((15),0)=[15 1 0] S((16),0)=[16 0] S((17),0)=[17 1 2 2 3 0] S((18),0)=[18 0] S((19),0)=[19 1 1 3 2 0] S((20),0)=[20 0] S((21),0)=[21 1 0] S((22),0)=[22 0] S((23),0)=[23 1 2 2 2 4 1 0] S((24),0)=[24 0] S((25),0)=[25 1 1 1 0] S((26),0)=[26 0] S((27),0)=[27 1 0] S((28),0)=[28 0] S((29),0)=[29 1 2 2 1 2 1 0] S((30),0)=[30 0] S((31),0)=[31 1 1 3 3 3 4 4 0] S((32),0)=[32 0] S((33),0)=[33 1 0] S((34),0)=[34 0] S((35),0)=[35 1 2 2 0] S((36),0)=[36 0] S((37),0)=[37 1 1 1 2 2 1 4 7 4 10 4 1 0] S((38),0)=[38 0] S((39),0)=[39 1 0] S((40),0)=[40 0] S((41),0)=[41 1 2 2 4 2 3 0] S((42),0)=[42 0] S((43),0)=[43 1 1 3 4 0] S((44),0)=[44 0] S((45),0)=[45 1 0] S((46),0)=[46 0] S((47),0)=[47 1 2 2 3 0] S((48),0)=[48 0] S((49),0)=[49 1 1 1 4 4 0] S((50),0)=[50 0] S((51),0)=[51 1 0] S((52),0)=[52 0] S((53),0)=[53 1 2 2 2 4 2 0] S((54),0)=[54 0] S((55),0)=[55 1 1 3 0] S((56),0)=[56 0] S((57),0)=[57 1 0] S((58),0)=[58 0] S((59),0)=[59 1 2 2 1 2 3 0] S((60),0)=[60 0] S((61),0)=[61 1 1 1 1 1 5 1 8 0] S((62),0)=[62 0] S((63),0)=[63 1 0] S((64),0)=[64 0] S((65),0)=[65 1 2 2 0] S((66),0)=[66 0] S((67),0)=[67 1 1 3 1 3 1 3 0] S((68),0)=[68 0] S((69),0)=[69 1 0] S((70),0)=[70 0] S((71),0)=[71 1 2 2 4 2 4 0] S((72),0)=[72 0] S((73),0)=[73 1 1 1 3 3 6 6 0] S((74),0)=[74 0] S((75),0)=[75 1 0] S((76),0)=[76 0] S((77),0)=[77 1 2 2 3 0] S((78),0)=[78 0] S((79),0)=[79 1 1 3 2 0] S((80),0)=[80 0] S((81),0)=[81 1 0] S((82),0)=[82 0] S((83),0)=[83 1 2 2 2 4 3 0] S((84),0)=[84 0] S((85),0)=[85 1 1 1 0] S((86),0)=[86 0] S((87),0)=[87 1 0] S((88),0)=[88 0] S((89),0)=[89 1 2 2 1 2 5 0] S((90),0)=[90 0] S((91),0)=[91 1 1 3 3 3 0] S((92),0)=[92 0] S((93),0)=[93 1 0] S((94),0)=[94 0] S((95),0)=[95 1 2 2 0] S((96),0)=[96 0] S((97),0)=[97 1 1 1 2 2 3 4 3 8 6 0] S((98),0)=[98 0] S((99),0)=[99 1 0]
maker((1,))
array([ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 99999999])