A334495 Position of prime(n) in A045572, a(1) = a(3) = 0.
0, 2, 0, 3, 5, 6, 7, 8, 10, 12, 13, 15, 17, 18, 19, 22, 24, 25, 27, 29, 30, 32, 34, 36, 39, 41, 42, 43, 44, 46, 51, 53, 55, 56, 60, 61, 63, 66, 67, 70, 72, 73, 77, 78, 79, 80, 85, 90, 91, 92, 94, 96, 97, 101, 103, 106, 108, 109, 111, 113, 114, 118, 123, 125, 126
Offset: 1
Examples
a(1) = a(3) = 0 by definition, since 2 and 5 are not in A045572. a(2) = 2 since A045572(2) = 3, a(10) = 12 since prime(10) = 29 = A045572(12), etc.
Programs
-
Mathematica
Array[If[FreeQ[{2, 5}, #], 4 #1 + (#2 + 1)/2 - Boole[#2 > 5] & @@ QuotientRemainder[#, 10], 0] &@ Prime@ # &, 65]
Formula
For prime p_n for n =/= 1 nor n =/= 3, a(p_n) = 4*q + (r + 1)/2 - [r > 5] (Iverson brackets), where q = floor(p_n/10) and r = p_n mod 10.
Comments