A157733 a(0)=2, a(1)=3. Then 2 or 22 followed by a string of 3's such that the sum of the digits of a(n) is equal to prime(n).
2, 3, 23, 223, 2333, 22333, 233333, 2233333, 23333333, 2333333333, 22333333333, 2233333333333, 23333333333333, 223333333333333, 2333333333333333, 233333333333333333, 23333333333333333333, 223333333333333333333
Offset: 0
Examples
a(3) = 23 because the third prime is 5 and 2 + 3 = 5. a(4) = 223 because the fourth prime is 7 and 2 + 2 + 3 = 7. a(5) = 2333 because the fifth prime is 11 and 2 + 3 + 3 + 3 = 11.
Programs
-
Mathematica
Module[{nn = 30, t1, t2}, t1 = FromDigits/@Select[Table[PadRight[{2}, n, 3], {n, 2, nn}], PrimeQ[Total[#]] &]; t2 = FromDigits/@ Select[ Table[ PadRight[{2, 2}, n, 3], {n, 2, nn}], PrimeQ[Total[#]] &]; Union[ Join[ {2, 3}, t1, t2]]] (* Harvey P. Dale, Mar 06 2013 *)
Extensions
Edited by R. J. Mathar, Mar 15 2009
Comments