A386964 a(1) = prime(1) = 2, a(n) = 10*a(n-1) + (prime(n) mod 10).
2, 23, 235, 2357, 23571, 235713, 2357137, 23571379, 235713793, 2357137939, 23571379391, 235713793917, 2357137939171, 23571379391713, 235713793917137, 2357137939171373, 23571379391713739, 235713793917137391, 2357137939171373917, 23571379391713739171, 235713793917137391713
Offset: 1
Links
- Michael S. Branicky, Table of n, a(n) for n = 1..1000
Programs
-
Maple
a:= proc(n) option remember; `if`(n<1, 0, a(n-1)*10+irem(ithprime(n), 10)) end: seq(a(n), n=1..21); # Alois P. Heinz, Aug 12 2025
-
Mathematica
a[1]=2;a[n_]:=10a[n-1]+Mod[Prime[n],10];Array[a,21] (* James C. McMahon, Aug 12 2025 *)
-
Python
from sympy import nextprime from itertools import islice def A386964(): # generator of terms an = pn = 2 while True: yield an an = 10*an + (pn:=nextprime(pn))%10 print(list(islice(A386964(), 21)))
Comments