cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-1 of 1 results.

A078970 Cycle of the inventory sequence (as in A063850) starting with n consists of prime numbers.

Original entry on oeis.org

39, 93, 349, 394, 439, 493, 934, 943, 999, 1139, 1193, 1319, 1391, 1913, 1931, 1999, 3139, 3193, 3319, 3339, 3391, 3393, 3913, 3931, 3933, 9111, 9139, 9193, 9319, 9391, 9399, 9913, 9931, 9939, 9993, 11129, 11192, 11219, 11291, 11912, 11921, 12119, 12191, 12239
Offset: 1

Views

Author

Joseph L. Pe, Jan 14 2003

Keywords

Comments

It can be proved that any inventory sequence ends in a cycle all of whose terms are <= 10^20.

Examples

			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, so 39 is in the sequence.
		

Crossrefs

Programs

  • 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]]]; l

Extensions

Missing terms inserted by Sean A. Irvine, Jul 25 2025
Showing 1-1 of 1 results.