login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 60th year, we have over 367,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Other ways to Give
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A301797 a(n) = (4^prime(n) - 1)/3. 0
5, 21, 341, 5461, 1398101, 22369621, 5726623061, 91625968981, 23456248059221, 96076792050570581, 1537228672809129301, 6296488643826193618261, 1611901092819505566274901, 25790417485112089060398421, 6602346876188694799461995861, 27043212804868893898596335048021 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
Also, numbers with a prime number of bits 1 (cf. A001348), interleaved with bits 0. Or: odd numbers with alternating binary digits and a prime Hamming weight A000120, cf. A052294. - M. F. Hasler, Oct 16 2018
LINKS
FORMULA
a(n) = A002450(A000040(n)). - Michel Marcus, Mar 27 2018
EXAMPLE
For n = 1, the first prime number is 2, so a(1) = (4^2-1)/3 = (16-1)/3 = 15/3 = 5;
for n = 2, prime(2) = 3, so a(2) = (4^3-1)/3 = (64-1)/3 = 63/3 = 21;
for n = 5, prime(5) = 11, so a(5) = (4^(11)-1)/3 = (4194304-1)/3 = 4194303/3 = 1398101.
MATHEMATICA
a[n_]:=(4^Prime[n] - 1)/3; Array[a, 50] (* Stefano Spezia, Oct 16 2018 *)
PROG
(Java) public static int a(int n){ int p = 1; while(n > 0){ p++; if(!new String(new char[p]).matches("(..+?)\\1+|.?")){ n--; } } return ((int) Math.pow(4, p)-1)/3; }
(PARI) a(n) = (4^prime(n) - 1)/3; \\ Michel Marcus, Mar 27 2018
(Magma) [(4^NthPrime(n) - 1)/3: n in [1..20]]; // Vincenzo Librandi, Oct 17 2018
CROSSREFS
Subsequence of A006995 and of A002450, which is a subsequence of A000975.
Also the intersection of A002450 and A052294.
Sequence in context: A241467 A267020 A141798 * A015461 A101694 A006109
KEYWORD
nonn,easy
AUTHOR
André Dalwigk, Mar 26 2018
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified December 9 02:18 EST 2023. Contains 367681 sequences. (Running on oeis4.)