cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A305377 Tribonacci representation of primes, written in base 10.

This page as a plain text file.
%I A305377 #18 Jun 12 2018 21:13:32
%S A305377 2,3,5,8,12,16,20,22,27,37,40,48,52,54,67,74,82,84,91,99,101,108,130,
%T A305377 137,147,152,154,162,164,169,194,198,205,209,256,258,265,273,277,288,
%U A305377 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 A305377 Tribonacci representation of primes, written in base 10.
%H A305377 Robert Israel, <a href="/A305377/b305377.txt">Table of n, a(n) for n = 1..10001</a>
%p A305377 L[0]:= [0]: L[1]:= [1]:
%p A305377 for d from 2 to 15 do
%p A305377   L[d]:= map(t -> (2*t, `if`(t mod 4 <> 3, 2*t+1,NULL)), L[d-1])
%p A305377 od:
%p A305377 A003726:=map(op,[seq(L[i],i=0..15)]):
%p A305377 seq(A003726[ithprime(i)+1],i=1..numtheory:-pi(nops(A003726)-1)); # _Robert Israel_, Jun 12 2018
%o A305377 (Python)
%o A305377 from sympy import prime
%o A305377 def A305377(n):
%o A305377     m, tlist, s = prime(n), [1,2,4], 0
%o A305377     while tlist[-1]+tlist[-2]+tlist[-3] <= m:
%o A305377         tlist.append(tlist[-1]+tlist[-2]+tlist[-3])
%o A305377     for d in tlist[::-1]:
%o A305377         s *= 2
%o A305377         if d <= m:
%o A305377             s += 1
%o A305377             m -= d
%o A305377     return s # _Chai Wah Wu_, Jun 12 2018
%Y A305377 Equals A003726(prime(n)).
%Y A305377 Cf. A278038, A305379.
%K A305377 nonn,base
%O A305377 1,1
%A A305377 _N. J. A. Sloane_, Jun 12 2018
%E A305377 More terms from _Robert Israel_, Jun 12 2018