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.

Showing 1-9 of 9 results.

A077718 Primes which can be expressed as sum of distinct powers of 4.

Original entry on oeis.org

5, 17, 257, 277, 337, 1093, 1109, 1297, 1301, 1361, 4177, 4357, 4373, 4421, 5189, 5381, 5393, 5441, 16453, 16657, 16661, 17477, 17489, 17669, 17681, 17729, 17749, 20549, 20753, 21521, 21569, 21589, 21841, 65537, 65557, 65617, 65809, 66629
Offset: 1

Views

Author

Amarnath Murthy, Nov 19 2002

Keywords

Comments

Primes whose base 4 representation contains only zeros and 1's.
As a subsequence of primes in A000695, these could be called Moser-de Bruijn primes. See also A235461 for those terms whose base 4 representation also represents a prime in base 2. - M. F. Hasler, Jan 11 2014

Crossrefs

Programs

  • Maple
    f:= proc(n) local L,x;
      L:= convert(n,base,2);
      x:= 1+add(L[i]*4^i,i=1..nops(L));
      if isprime(x) then x fi
    end proc:
    map(f, [$1..1000]); # Robert Israel, Sep 06 2018
  • Mathematica
    Select[Prime[Range[6650]],Max[IntegerDigits[#,4]]<=1&] (* Jayanta Basu, May 22 2013 *)
  • PARI
    for(i=1,999,isprime(b=vector(#b=binary(i),j,4^(#b-j))*b~)&&print1(b",")) \\ - M. F. Hasler, Jan 12 2014

Extensions

More terms from Sascha Kurz, Jan 03 2003

A077722 Primes which can be expressed as sums of distinct powers of 8.

Original entry on oeis.org

73, 521, 577, 4673, 32833, 33289, 33353, 36929, 37441, 262153, 262217, 262657, 295433, 299017, 299521, 2097673, 2101249, 2101313, 2134529, 2359369, 2359873, 2363393, 2363401, 2392073, 16777289, 16777729, 16810049, 16810561, 16814089
Offset: 1

Views

Author

Amarnath Murthy, Nov 19 2002

Keywords

Comments

Primes whose base 8 representations contain only 0's and 1's.
Intersection of A000040 and A033045. - Michel Marcus, Sep 14 2013

Crossrefs

Programs

  • PARI
    isok(n) = {digs = digits(n, 8); for (i = 1, #digs, if (digs[i] > 1, return (0));); return (1);}
    lista(nn) = {forprime (p=1, nn, if (isok(p), print1(p, ", ");););} \\ Michel Marcus, Sep 14 2013
    
  • PARI
    forstep(n=7,999,2,t=fromdigits(binary(n),8); if(isprime(t), print1(t", "))) \\ Charles R Greathouse IV, Jun 08 2015

Extensions

More terms from Francois Jooste (phukraut(AT)hotmail.com), Dec 23 2002

A077717 Primes which can be expressed as a sum of distinct powers of 3.

Original entry on oeis.org

3, 13, 31, 37, 109, 271, 283, 337, 733, 739, 757, 769, 811, 823, 1009, 1063, 1093, 2269, 2281, 2467, 2521, 2539, 2551, 2917, 2953, 3001, 3037, 3163, 3169, 3187, 3253, 3271, 6571, 6673, 6679, 6841, 7321, 7411, 7537, 7561, 7573, 8761, 8779, 8839, 9001
Offset: 1

Views

Author

Amarnath Murthy, Nov 19 2002

Keywords

Comments

Primes whose base 3 representation contains only 0's and 1's.

Examples

			31 = 3^3 + 3 + 1 belongs to this sequence.
		

Crossrefs

Programs

Extensions

More terms from John W. Layman, Nov 22 2002

A077721 Primes which can be expressed as sum of distinct powers of 7.

Original entry on oeis.org

7, 2801, 17207, 19559, 120401, 134513, 134807, 137201, 840743, 842759, 842801, 941249, 943601, 958007, 958049, 958343, 960793, 5782001, 5784409, 5899307, 5899601, 5899657, 5901659, 6591089, 6607903, 6706393, 6708787, 6722801, 6722857, 6723193
Offset: 1

Views

Author

Amarnath Murthy, Nov 19 2002

Keywords

Comments

Primes whose base 7 representation contains only zeros and 1's.

Crossrefs

Programs

  • Maple
    pos := 0:for i from 1 to 4000 do b := convert(i,base,2); s := sum(b[j]*7^(j-1),j=1..nops(b)): if(isprime(s)) then pos := pos+1:a[pos] := s:fi: od:seq(a[j],j=1..pos);
  • Mathematica
    Select[Prime[Range[10^6]], Max[IntegerDigits[#, 7]]<=1 &] (* Vincenzo Librandi, Sep 07 2018 *)

Extensions

More terms from Sascha Kurz, Jan 03 2003

A077719 Primes which can be expressed as sum of distinct powers of 5.

Original entry on oeis.org

5, 31, 131, 151, 631, 751, 3251, 3881, 16381, 19381, 19501, 19531, 78781, 78901, 81281, 81401, 81901, 82031, 93901, 94531, 97001, 97501, 97651, 390751, 390781, 393901, 394501, 406381, 468781, 469501, 471901, 472631, 484531, 485131, 487651, 1953151, 1953901
Offset: 1

Views

Author

Amarnath Murthy, Nov 19 2002

Keywords

Comments

Primes whose base 5 representation contains only zeros and 1's.

Crossrefs

Programs

  • Python
    from sympy import isprime
    def aupton(terms):
      k, alst = 0, []
      while len(alst) < terms:
        k += 1
        t = sum(5**i*int(di) for i, di in enumerate((bin(k)[2:])[::-1]))
        if isprime(t): alst.append(t)
      return alst
    print(aupton(37)) # Michael S. Branicky, May 31 2021

Extensions

More terms from Sascha Kurz, Jan 03 2003
a(36) and beyond from Michael S. Branicky, May 31 2021

A077723 Primes which can be expressed as sum of distinct powers of 9.

Original entry on oeis.org

739, 811, 6571, 59779, 65701, 532261, 538093, 591301, 597133, 597781, 4783699, 4789621, 4842109, 4849399, 5314411, 5314501, 5373469, 5374279, 5380831, 43047541, 43112341, 43113061, 43643773, 43643863, 47837071, 47888821
Offset: 1

Views

Author

Amarnath Murthy, Nov 19 2002

Keywords

Comments

Primes whose base 9 representation contains only zeros and 1's.

Crossrefs

Programs

  • Mathematica
    Select[Prime[Range[3000000]],Union[Most[Rest[DigitCount[#,9]]]]=={0}&] (* Harvey P. Dale, Jul 31 2013 *)
  • PARI
    lista(nn) = {forprime(p=2, nn, if (vecmax(digits(p, 9)) <= 1, print1(p, ", ")););} \\ Michel Marcus, Oct 10 2014

Extensions

More terms from Sascha Kurz, Jan 03 2003

A077724 a(n) = smallest prime which can be expressed as a sum of distinct powers of n.

Original entry on oeis.org

2, 3, 5, 5, 7, 7, 73, 739, 11, 11, 13, 13, 197, 241, 17, 17, 19, 19, 401, 463, 23, 23, 577, 10171901, 677, 757, 29, 29, 31, 31, 32801, 1123, 1336337, 44101, 37, 37, 1483, 59359, 41, 41, 43, 43, 85229, 93151, 47, 47, 110641, 13847169701, 2551, 345157903, 53, 53
Offset: 2

Views

Author

Amarnath Murthy, Nov 19 2002

Keywords

Comments

a(n) = smallest prime whose base n representation contains only zeros and 1's.
Values of n at which a(n) reach record values are: 2, 3, 4, 6, 8, 9, 25, 49, 91, 121, 187, 201, 301, 721, 799, 841... Notably, many of them are squares of primes. - Ivan Neretin, Sep 20 2017

Crossrefs

Programs

  • Mathematica
    Table[i = p = 1; While[! PrimeQ[p], p = FromDigits[IntegerDigits[i++, 2], n]]; p, {n, 2, 53}] (* Ivan Neretin, Sep 20 2017 *)
  • Python
    from itertools import count
    from sympy import isprime
    def A077724(n): return next(filter(isprime,(sum(n**i for i, j in enumerate(bin(m)[-1:1:-1]) if j=='1') for m in count(1)))) # Chai Wah Wu, Apr 04 2025

Extensions

More terms from Sascha Kurz, Jan 03 2003

A235463 Primes whose base-6 representation also is the base-2 representation of a prime.

Original entry on oeis.org

7, 37, 43, 223, 1297, 1303, 1549, 7993, 9109, 46663, 54469, 55987, 326593, 1679659, 1681129, 1727569, 1734049, 1967587, 2006461, 2007763, 2014027, 2015287, 10077919, 10125649, 10125691, 10133467, 10412107, 10413397, 11757349, 11766421, 11766427, 11766637
Offset: 1

Views

Author

M. F. Hasler, Jan 11 2014

Keywords

Comments

This sequence is part of the two-dimensional array of sequences based on this same idea for any two different bases b, c > 1. Sequence A235265 and A235266 are the most elementary ones in this list. Sequences A089971, A089981 and A090707 through A090721, and sequences A065720 - A065727, follow the same idea with one base equal to 10.
For further motivation and cross-references, see sequence A235265 which is the main entry for this whole family of sequences.
When the smaller base is b=2 such that only digits 0 and 1 are allowed, these are primes that are the sum of distinct powers of the larger base, here c=6, thus a subsequence of A077720.

Examples

			7 = 11_6 and 11_2 = 3 are both prime, so 7 is a term.
37 = 101_6 and 101_2 = 5 are both prime, so 37 is a term.
		

Crossrefs

Cf. A065720A036952, A065721 - A065727, A235394, A235395, A089971A020449, A089981, A090707 - A091924, A235461 - A235482. See the LINK for further cross-references.

Programs

  • Mathematica
      b62Q[n_]:=Module[{idn6=IntegerDigits[n,6]},Max[idn6]<2&&AllTrue[ {FromDigits[ idn6,6],FromDigits[idn6,2]},PrimeQ]]; Select[Prime[ Range[ 4,780000]],b62Q] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, May 29 2020 *)
  • PARI
    is(p,b=2,c=6)=vecmax(d=digits(p,c))
    				
  • PARI
    forprime(p=1,1e3,is(p,6,2)&&print1(vector(#d=digits(p,2),i,6^(#d-i))*d~,",")) \\ To produce the terms, this is much more efficient than to select them using straightforwardly is(.)=is(.,2,6)

A235476 Primes whose base-2 representation also is the base-6 representation of a prime.

Original entry on oeis.org

3, 5, 7, 11, 17, 19, 29, 41, 53, 67, 101, 127, 193, 263, 281, 337, 353, 431, 461, 479, 487, 499, 523, 593, 599, 631, 743, 757, 773, 821, 823, 829, 857, 883, 887, 941, 1013, 1021, 1093, 1117, 1259, 1279, 1303, 1367, 1373, 1429, 1439, 1459, 1471, 1483, 1493, 1511, 1583, 1619, 1699, 1759, 1831, 1847, 1879, 1931, 1951, 1987
Offset: 1

Views

Author

M. F. Hasler, Jan 12 2014

Keywords

Comments

This sequence is part of a two-dimensional array of sequences, given in the LINK, based on this same idea for any two different bases b, c > 1. Sequence A235265 and A235266 are the most elementary ones in this list. Sequences A089971, A089981 and A090707 through A090721, and sequences A065720 - A065727, follow the same idea with one base equal to 10.
For further motivation and cross-references, see sequence A235265 which is the main entry for this whole family of sequences.

Examples

			5 = 101_2 and 101_6 = 37 are both prime, so 5 is a term.
7 = 111_2 and 111_6 = 43 are both prime, so 7 is a term.
		

Crossrefs

Cf. A235463A077720, A235475, A152079, A235266, A065720A036952, A065721 - A065727, A089971A020449, A089981, A090707 - A091924, A235394, A235395, A235461 - A235482. See the LINK for further cross-references.

Programs

  • Mathematica
    Select[Prime[Range[300]],PrimeQ[FromDigits[IntegerDigits[#,2],6]]&] (* Harvey P. Dale, Jan 03 2022 *)
  • PARI
    is(p,b=6)=isprime(vector(#d=binary(p),i,b^(#d-i))*d~)&&isprime(p)
Showing 1-9 of 9 results.