The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A078970 Cycle of the inventory sequence (as in A063850) starting with n consists of prime numbers. 4
39, 1319, 211319, 12311319, 41122319, 1431221319, 4114232219, 2431321319, 2214333119, 2231143319, 2233311419, 2233311419 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
It can be proved that any inventory sequence ends in a cycle all of whose terms are <= 10^20.
LINKS
EXAMPLE
The inventory sequence starting with 39 is: 39, 1319, 211319, 12311319, 41122319, 1431221319, 4114232219, 2431321319, 2214333119, 2231143319, 2233311419, 2233311419, .... The cycle is 2233311419, 2233311419, .... and 2233311419 is prime.
MATHEMATICA
g[n_] := Module[{seen, r, d, l, i, t}, seen = {}; r = {}; d = IntegerDigits[n]; l = Length[d]; For[i = 1, i <= l, i++, t = d[[i]]; If[ ! MemberQ[seen, t], r = Join[r, IntegerDigits[Count[d, t]]]; r = Join[r, {t}]; seen = Append[seen, t]]]; FromDigits[r]];
pr[n_] := Module[{r, t, p1, p, a}, r = {}; t = g[n]; a = True; While[ ! MemberQ[r, t], r = Append[r, t]; t = g[t]]; r = Append[r, t]; p1 = Flatten[Position[r, t]]; p = PrimeQ[Drop[r, p1[[1]]]]; If[MemberQ[p, False], a = False]; a]; l = {}; For[k = 1, k <= 10^4, k++, If[pr[k], l = Append[l, k]]]
CROSSREFS
Sequence in context: A227524 A240442 A009729 * A020303 A235973 A097314
KEYWORD
base,nice,nonn
AUTHOR
Joseph L. Pe, Jan 14 2003
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified June 4 17:49 EDT 2024. Contains 373102 sequences. (Running on oeis4.)