login
A305377
Tribonacci representation of primes, written in base 10.
2
2, 3, 5, 8, 12, 16, 20, 22, 27, 37, 40, 48, 52, 54, 67, 74, 82, 84, 91, 99, 101, 108, 130, 137, 147, 152, 154, 162, 164, 169, 194, 198, 205, 209, 256, 258, 265, 273, 277, 288, 294, 297, 309, 320, 324, 326, 341, 358, 363, 365, 387, 394, 396, 409, 419, 426, 434, 436, 515, 520, 522, 534, 554, 560
OFFSET
1,1
LINKS
MAPLE
L[0]:= [0]: L[1]:= [1]:
for d from 2 to 15 do
L[d]:= map(t -> (2*t, `if`(t mod 4 <> 3, 2*t+1, NULL)), L[d-1])
od:
A003726:=map(op, [seq(L[i], i=0..15)]):
seq(A003726[ithprime(i)+1], i=1..numtheory:-pi(nops(A003726)-1)); # Robert Israel, Jun 12 2018
PROG
(Python)
from sympy import prime
def A305377(n):
m, tlist, s = prime(n), [1, 2, 4], 0
while tlist[-1]+tlist[-2]+tlist[-3] <= m:
tlist.append(tlist[-1]+tlist[-2]+tlist[-3])
for d in tlist[::-1]:
s *= 2
if d <= m:
s += 1
m -= d
return s # Chai Wah Wu, Jun 12 2018
CROSSREFS
Equals A003726(prime(n)).
Sequence in context: A028766 A342494 A022487 * A062489 A084624 A238548
KEYWORD
nonn,base
AUTHOR
N. J. A. Sloane, Jun 12 2018
EXTENSIONS
More terms from Robert Israel, Jun 12 2018
STATUS
approved