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-2 of 2 results.

A378417 a(n) is the least k such that A127064(k) = n.

Original entry on oeis.org

0, 1, 2, 3, 4, 17, 24, 62, 68, 162, 169, 176, 183, 188, 369, 694, 897, 988, 1027, 4183, 5510, 6063, 6341, 6444, 6465, 25787, 32844, 37722, 38811, 39450, 151679, 200946, 226703, 240056, 248947, 430398, 612633, 633473, 635344, 637227, 637237, 637256, 637306, 1095790, 1353912, 1554970, 7045573
Offset: 1

Views

Author

Robert Israel, Nov 25 2024

Keywords

Comments

a(n) is the least k such that n - 1 iterations of A004648 (k -> prime(k) (mod k)) are needed to reach 0.

Examples

			a(6) = 17 because 5 iterations of A004648 starting at 17 result in 0, and every k < 17 requires fewer iterations:
  prime(17) (mod 17) = 59 (mod 17) = 8
  prime(8) (mod 8) = 19 (mod 8) = 3
  prime(3) (mod 3) = 5 (mod 3) = 2
  prime(2) (mod 2) = 3 (mod 2) = 1
  prime(1) (mod 1) = 2 (mod 1) = 0.
		

Crossrefs

Programs

  • Maple
    P:= select(isprime, [2,seq(i,i=3..10^8,2)]): nP:= nops(P):
    V:= Array(0..nP): count:= 0: R[1]:= 0:
    for n from 1 to nP do
    V[n]:= V[P[n] mod n]+1;
    if V[n] > count then count:= count+1; R[count]:= n fi;
    od:
    seq(R[i],i=1..count);

Formula

A127064(a(n)) = n.

A127066 a(0)=1; for n > 0, a(n) = a(n-1) + a(prime(n)(mod n)), where prime(n) is the n-th prime.

Original entry on oeis.org

1, 2, 4, 8, 16, 18, 20, 28, 36, 54, 108, 162, 164, 168, 170, 174, 192, 228, 256, 364, 526, 634, 802, 972, 1200, 2002, 2974, 3776, 4748, 5550, 6522, 6530, 6538, 6556, 6564, 6618, 6646, 6700, 6862, 7024, 7192, 7366, 7534, 7898, 8126, 8354, 8528, 9500, 16030
Offset: 0

Views

Author

Leroy Quet, Mar 21 2007

Keywords

Examples

			The 7th prime, 17, is congruent to 3 (mod 7). So a(7) = a(6) + a(3) = 20 + 8 = 28.
		

Crossrefs

Programs

  • Maple
    a:=proc(n) if n=0 then 1 else a(n-1)+a(ithprime(n) mod n) fi end: seq(a(n),n=0..55); # Emeric Deutsch, Mar 23 2007
  • Mathematica
    f[l_List] := Block[{n = Length[l]},Append[l, l[[Mod[Prime[n], n] + 1]] + l[[ -1]]]]; Nest[f, {1}, 50] (* Ray Chandler, Mar 23 2007 *)

Extensions

More terms from Emeric Deutsch and Ray Chandler, Mar 23 2007
Showing 1-2 of 2 results.