Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #18 Jun 12 2018 21:13:32
%S 2,3,5,8,12,16,20,22,27,37,40,48,52,54,67,74,82,84,91,99,101,108,130,
%T 137,147,152,154,162,164,169,194,198,205,209,256,258,265,273,277,288,
%U 294,297,309,320,324,326,341,358,363,365,387,394,396,409,419,426,434,436,515,520,522,534,554,560
%N Tribonacci representation of primes, written in base 10.
%H Robert Israel, <a href="/A305377/b305377.txt">Table of n, a(n) for n = 1..10001</a>
%p L[0]:= [0]: L[1]:= [1]:
%p for d from 2 to 15 do
%p L[d]:= map(t -> (2*t, `if`(t mod 4 <> 3, 2*t+1,NULL)), L[d-1])
%p od:
%p A003726:=map(op,[seq(L[i],i=0..15)]):
%p seq(A003726[ithprime(i)+1],i=1..numtheory:-pi(nops(A003726)-1)); # _Robert Israel_, Jun 12 2018
%o (Python)
%o from sympy import prime
%o def A305377(n):
%o m, tlist, s = prime(n), [1,2,4], 0
%o while tlist[-1]+tlist[-2]+tlist[-3] <= m:
%o tlist.append(tlist[-1]+tlist[-2]+tlist[-3])
%o for d in tlist[::-1]:
%o s *= 2
%o if d <= m:
%o s += 1
%o m -= d
%o return s # _Chai Wah Wu_, Jun 12 2018
%Y Equals A003726(prime(n)).
%Y Cf. A278038, A305379.
%K nonn,base
%O 1,1
%A _N. J. A. Sloane_, Jun 12 2018
%E More terms from _Robert Israel_, Jun 12 2018