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-10 of 65 results. Next

A235266 Primes whose base-2 representation is also the base-3 representation of a prime.

Original entry on oeis.org

2, 7, 11, 13, 41, 47, 67, 73, 79, 109, 127, 151, 173, 181, 191, 193, 211, 223, 227, 229, 233, 251, 283, 331, 367, 421, 443, 487, 541, 557, 563, 587, 601, 607, 631, 641, 661, 677, 719, 733, 877, 941, 947, 967, 971, 1033, 1187, 1193, 1201, 1301, 1321, 1373, 1447, 1451, 1471, 1531, 1567, 1571, 1657, 1667, 1669, 1697, 1709, 1759
Offset: 1

Views

Author

M. F. Hasler, Jan 05 2014

Keywords

Crossrefs

Cf. A090707 - A091924, A235461 - A235482. See the LINK for further cross-references.

Programs

  • Maple
    f:= proc(n) local L,i;
      L:= convert(n,base,2);
      isprime(add(L[i]*3^(i-1),i=1..nops(L)))
    end proc:
    select(f, [seq(ithprime(i),i=1..1000)]); # Robert Israel, Jun 03 2019
  • Mathematica
    Select[Prime@ Range@ 250, PrimeQ@ FromDigits[IntegerDigits[#, 2], 3] &] (* Michael De Vlieger, Jun 03 2019 *)
  • PARI
    is(p,b=3,c=2)=isprime(vector(#d=digits(p,c),i,b^(#d-i))*d~)&&isprime(p) \\ This code can be used for other bases b,c when b>c. See A235265 for code valid for b
    				
  • PARI
    forprime(p=2, 1e3, if(isprime(fromdigits(binary(p), 3)), print1(p", "))) \\ Charles R Greathouse IV, Mar 28 2022
    
  • Python
    from sympy import isprime, nextprime
    def agen(): # generator of terms
        p = 2
        while True:
            p3 = sum(3**i for i, bi in enumerate(bin(p)[2:][::-1]) if bi=='1')
            if isprime(p3):
                yield p
            p = nextprime(p)
    g = agen()
    print([next(g) for n in range(1, 65)]) # Michael S. Branicky, Jan 16 2022

Formula

a(n) is the number whose base-3 representation is the base-2 representation of A235265(n).

A235461 Primes whose base-4 representation also is the base 2-representation of a prime.

Original entry on oeis.org

5, 17, 257, 277, 337, 1093, 1109, 1297, 1361, 4357, 5189, 16453, 16657, 16661, 17489, 17669, 17681, 17749, 21521, 21569, 21589, 65537, 65557, 65617, 65809, 66821, 70657, 70981, 70997, 81937, 82241, 83221, 83269, 86017, 86357, 87317, 263429, 263489, 267541, 278549
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=4, thus a subsequence of A077718 and therefore also of A000695, the Moser-de Bruijn sequence.

Examples

			5 = 11_4 and 11_2 = 3 are both prime, so 5 is a term.
17 = 101_4 and 101_2 = 5 are both prime, so 17 is a term.
		

Crossrefs

Cf. A090707 - A091924, A235462 - A235482. See the LINK for further cross-references.

Programs

  • PARI
    is(p,b=2,c=4)=vecmax(d=digits(p,c))
    				
  • Python
    from itertools import islice
    from sympy import nextprime, isprime
    def A235461_gen(): # generator of terms
        p = 1
        while (p:=nextprime(p)):
            if isprime(m:=int(bin(p)[2:],4)):
                yield m
    A235461_list = list(islice(A235461_gen(),20)) # Chai Wah Wu, Aug 21 2023

Extensions

a(37)-a(40) from Robert Price, Nov 01 2023

A235482 Primes whose base-5 representation is also the base-9 representation of a prime.

Original entry on oeis.org

2, 3, 7, 11, 17, 19, 37, 41, 61, 67, 71, 97, 109, 131, 139, 149, 151, 157, 167, 191, 197, 211, 251, 269, 281, 337, 349, 367, 401, 409, 439, 449, 457, 467, 487, 491, 499, 521, 557, 569, 607, 619, 631, 647, 661, 739, 761, 769, 821, 829, 887, 907, 941, 947, 967, 1009, 1019, 1031, 1061, 1069, 1087
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.
A subsequence of A197636 and of course of A000040A015919.

Examples

			41 = 131_5 and 131_9 = 109 are both prime, so 41 is a term.
		

Crossrefs

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

Programs

  • Mathematica
    Select[Prime@ Range@ 500, PrimeQ@ FromDigits[ IntegerDigits[#, 5], 9] &] (* Giovanni Resta, Sep 12 2019 *)
  • PARI
    is(p,b=9,c=5)=isprime(vector(#d=digits(p,c),i,b^(#d-i))*d~)&&isprime(p) \\ Note: Code only valid for b > c.

A229037 The "forest fire": sequence of positive integers where each is chosen to be as small as possible subject to the condition that no three terms a(j), a(j+k), a(j+2k) (for any j and k) form an arithmetic progression.

Original entry on oeis.org

1, 1, 2, 1, 1, 2, 2, 4, 4, 1, 1, 2, 1, 1, 2, 2, 4, 4, 2, 4, 4, 5, 5, 8, 5, 5, 9, 1, 1, 2, 1, 1, 2, 2, 4, 4, 1, 1, 2, 1, 1, 2, 2, 4, 4, 2, 4, 4, 5, 5, 8, 5, 5, 9, 9, 4, 4, 5, 5, 10, 5, 5, 10, 2, 10, 13, 11, 10, 8, 11, 13, 10, 12, 10, 10, 12, 10, 11, 14, 20, 13
Offset: 1

Views

Author

Jack W Grahl, Sep 11 2013

Keywords

Comments

Added name "forest fire" to make it easier to locate this sequence. - N. J. A. Sloane, Sep 03 2019
This sequence and A235383 and A235265 were winners in the best new sequence contest held at the OEIS Foundation booth at the 2014 AMS/MAA Joint Mathematics Meetings. - T. D. Noe, Jan 20 2014
See A236246 for indices n such that a(n)=1. - M. F. Hasler, Jan 20 2014
See A241673 for indices n such that a(n)=2^k. - Reinhard Zumkeller, Apr 26 2014
The graph (for up to n = 10000) has an eerie similarity (why?) to the distribution of rising smoke particles subjected to a lateral wind, and where the particles emanate from randomly distributed burning areas in a fire in a forest or field. - Daniel Forgues, Jan 21 2014
The graph (up to n = 100000) appears to have a fractal structure. The dense areas are not random but seem to repeat, approximately doubling in width and height each time. - Daniel Forgues, Jan 21 2014
a(A241752(n)) = n and a(m) != n for m < A241752(n). - Reinhard Zumkeller, Apr 28 2014
The indices n such that a(n) = 1 are given by A236313 (relative spacing) up to 19 terms, and A003278 (directly) up to 20 terms. If just placing ones, the 21st 1 would be n=91. The sequence A003278 fails at n=91 because the numbers filling the gaps create an arithmetic progression with a(27)=9, a(59)=5 and a(91)=1. Additionally, if you look at indices n starting at the first instance of 4 or 5, A003278/A236313 provide possible indices for a(n)=4 or a(n)=5, with some indexes instead filled by numbers < (4,5). A003278/A236313 also fail to predict indices for a(n)=4 or a(n)=5 by the ~20th term. - Daniel Putt, Sep 29 2022

Crossrefs

Cf. A094870, A362942 (partial sums).
For a variant see A309890.
A selection of sequences related to "no three-term arithmetic progression": A003002, A003003, A003278, A004793, A005047, A005487, A033157, A065825, A092482, A093678, A093679, A093680, A093681, A093682, A094870, A101884, A101886, A101888, A140577, A185256, A208746, A229037.

Programs

  • Haskell
    import Data.IntMap (empty, (!), insert)
    a229037 n = a229037_list !! (n-1)
    a229037_list = f 0 empty  where
       f i m = y : f (i + 1) (insert (i + 1) y m) where
         y = head [z | z <- [1..],
                       all (\k -> z + m ! (i - k) /= 2 * m ! (i - k `div` 2))
                           [1, 3 .. i - 1]]
    -- Reinhard Zumkeller, Apr 26 2014
    
  • Mathematica
    a[1] = 1; a[n_] := a[n] = Block[{z = 1}, While[Catch[ Do[If[z == 2*a[n-k] - a[n-2*k], Throw@True], {k, Floor[(n-1)/2]}]; False], z++]; z]; a /@ Range[100] (* Giovanni Resta, Jan 01 2014 *)
  • PARI
    step(v)=my(bad=List(),n=#v+1,t); for(d=1,#v\2,t=2*v[n-d]-v[n-2*d]; if(t>0, listput(bad,t))); bad=Set(bad); for(i=1,#bad, if(bad[i]!=i, return(i))); #bad+1
    first(n)=my(v=List([1])); while(n--, listput(v, step(v))); Vec(v) \\ Charles R Greathouse IV, Jan 21 2014
    
  • Python
    A229037_list = []
    for n in range(10**6):
        i, j, b = 1, 1, set()
        while n-2*i >= 0:
            b.add(2*A229037_list[n-i]-A229037_list[n-2*i])
            i += 1
            while j in b:
                b.remove(j)
                j += 1
        A229037_list.append(j) # Chai Wah Wu, Dec 21 2014

Formula

a(n) <= (n+1)/2. - Charles R Greathouse IV, Jan 21 2014

A235615 Primes whose base-5 representation also is the base-4 representation of a prime.

Original entry on oeis.org

2, 3, 13, 41, 43, 61, 181, 191, 263, 281, 283, 331, 383, 431, 443, 463, 641, 643, 661, 881, 911, 1063, 1091, 1291, 1303, 1531, 1693, 2083, 2143, 2203, 2293, 2341, 3163, 3181, 3191, 3253, 3343, 3593, 3761, 3931, 4001, 4093, 4391, 4691, 4793, 5011, 5393, 5413, 5441, 6301
Offset: 1

Views

Author

M. F. Hasler, Jan 13 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.

Examples

			Both 13 = 23_5 and 23_4 = 11 are prime.
		

Crossrefs

Cf. A235474, A235265, A235266, A152079, A235461 - A235482, A065720 - A065727, A235394, A235395, A089971A020449, A089981, A090707 - A091924, A235615 - A235639. See the LINK for further cross-references.

Programs

  • PARI
    is(p,b=4,c=5)=vecmax(d=digits(p,c))
    				
  • PARI
    forprime(p=1,3e3,is(p,5,4)&&print1(vector(#d=digits(p,4),i,5^(#d-i))*d~,",")) \\ To produce the terms, this is more efficient than to select them using straightforwardly is(.)=is(.,4,5)

A235639 Primes whose base-9 representation is also the base-6 representation of a prime.

Original entry on oeis.org

2, 3, 5, 19, 23, 41, 113, 127, 131, 163, 199, 271, 419, 433, 739, 743, 761, 919, 991, 1009, 1013, 1063, 1153, 1171, 1459, 1481, 1499, 1553, 1567, 1571, 1733, 1747, 1783, 1873, 1913, 2237, 2377, 2381, 2539, 2557, 2593, 2633, 2939, 3011, 3079, 3083, 3187, 3259, 3331, 3659
Offset: 1

Views

Author

M. F. Hasler, Jan 13 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.

Examples

			19 = 21_9 and 21_6 = 13 are both prime, so 19 is a term.
509 = 625_9 and 625_6 = 17 are both prime, but 625 is not a valid base-6 integer, so 509 is not a term.
		

Crossrefs

Cf. A231481, A235265, A235266, A152079, A235461 - A235482, A065720 - A065727, A235394, A235395, A089971A020449, A089981, A090707 - A091924, A235615 - A235638. See the LINK for further cross-references.

Programs

  • Maple
    R:= 2: x:= 2: count:= 1:
    while count < 100 do
      x:= nextprime(x);
      L:= convert(x,base,6);
      y:= add(9^(i-1)*L[i],i=1..nops(L));
      if isprime(y) then count:= count+1; R:= R, y fi
    od:
    R; # Robert Israel, May 18 2020
  • PARI
    is(p,b=6,c=9)=vecmax(d=digits(p,c))
    				
  • PARI
    forprime(p=1,3e3,is(p,9,6)&&print1(vector(#d=digits(p,6),i,9^(#d-i))*d~,",")) \\ To produce the terms, this is more efficient than to select them using straightforwardly is(.)=is(.,6,9)

A235475 Primes whose base-2 representation also is the base-5 representation of a prime.

Original entry on oeis.org

2, 7, 11, 13, 19, 41, 59, 127, 151, 157, 167, 173, 181, 191, 223, 233, 241, 271, 313, 331, 409, 421, 443, 463, 541, 563, 577, 607, 613, 641, 701, 709, 733, 743, 809, 859, 877, 919, 929, 953, 967, 991, 1021, 1033, 1069, 1087, 1193, 1259, 1373, 1423, 1451, 1453, 1471, 1483, 1493, 1549, 1697, 1753, 1759, 1783, 1787, 1831, 1877, 1979, 1993
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

			7 = 111_2 and 111_5 = 31 are both prime, so 7 is a term.
		

Crossrefs

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

Programs

  • Mathematica
    Select[Prime[Range[400]],PrimeQ[FromDigits[IntegerDigits[#,2],5]]&] (* Harvey P. Dale, Jun 15 2019 *)
  • PARI
    is(p,b=5,c=2)=isprime(vector(#d=digits(p,c),i,b^(#d-i))*d~)&&isprime(p) \\ This code is only valid for b>c.

A267769 Numbers whose base-9 representation is a square when read in base 10.

Original entry on oeis.org

0, 1, 4, 15, 23, 33, 58, 73, 81, 100, 121, 185, 213, 265, 298, 324, 361, 400, 474, 509, 555, 643, 685, 751, 861, 914, 1093, 1153, 1215, 1288, 1354, 1481, 1554, 1705, 1783, 1863, 1945, 2029, 2210, 2301, 2488, 2584, 2673, 2773, 2875, 3101, 3210, 3424, 3538, 3682, 3802, 4038, 4154, 4281, 4450
Offset: 1

Views

Author

M. F. Hasler, Jan 20 2016

Keywords

Comments

Trivially includes powers of 81, since 81^k = 100..00_9 = 10^(2k) when read in base 10. Moreover, for any a(n) in the sequence, 81*a(n) is also in the sequence. One could call "primitive" the terms not of this form. These primitive terms include the subsequence 81^k + 2*9^k + 1 = (9^k+1)^2, k > 0, which yields A033934 when written in base 9.

Crossrefs

Cf. A267763 - A267768 for bases 3 through 8. The base-2 analog is A000302 = powers of 4.

Programs

  • Mathematica
    Select[Range[0, 5000], IntegerQ@ Sqrt@ FromDigits@ IntegerDigits[#, 9] &] (* Michael De Vlieger, Jan 24 2016 *)
  • PARI
    is(n,b=9,c=10)=issquare(subst(Pol(digits(n,b)),x,c))
    
  • Python
    A267769_list = [int(s, 9) for s in (str(i**2) for i in range(10**6)) if max(s) < '9'] # Chai Wah Wu, Jan 20 2016

A235473 Primes whose base-3 representation is also the base-4 representation of a prime.

Original entry on oeis.org

2, 43, 61, 67, 97, 103, 127, 139, 151, 157, 199, 211, 229, 277, 283, 331, 337, 349, 373, 379, 433, 439, 463, 499, 523, 571, 601, 607, 727, 751, 787, 823, 853, 883, 919, 991, 1063, 1087, 1117, 1213, 1249, 1327, 1381, 1429, 1483, 1531, 1567, 1597, 1627, 1759, 1783, 1867, 1999
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.
This is a subsequence of A045331 and A045375.

Examples

			43 = 1121_3 and 1121_4 = 89 are both prime, so 43 is a term.
		

Crossrefs

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

Programs

  • Mathematica
    Select[Prime[Range[400]],PrimeQ[FromDigits[IntegerDigits[#,3],4]]&] (* Harvey P. Dale, Oct 16 2015 *)
  • PARI
    is(p,b=4,c=3)=isprime(vector(#d=digits(p,c),i,b^(#d-i))*d~)&&isprime(p) \\ Note: This code is only valid for b > c.

A267763 Numbers whose base-3 representation is a square when read in base 10.

Original entry on oeis.org

0, 1, 9, 16, 81, 100, 144, 235, 729, 784, 900, 961, 1296, 1369, 2115, 6561, 6724, 7056, 7225, 8100, 8649, 11664, 11881, 12321, 15985, 19035, 59049, 59536, 60516, 61009, 63504, 64009, 65025, 72900, 73441, 77841, 104976, 105625, 106929, 110889, 143865, 171315, 182428, 531441, 532900, 535824, 537289, 544644, 546121
Offset: 1

Views

Author

M. F. Hasler, Jan 20 2016

Keywords

Comments

Trivially includes powers of 9, since 9^k = 100..00_3 = 10^(2k) when read as a base-10 number. Moreover, for any a(n) in the sequence, 9*a(n) is also in the sequence. One could call "primitive" the terms not of this form; these would be 1, 16 = 121_3, 100 = 10201_3, 235 = 22201_3, 784 = 1002001_3, 961 = 1022121_3, ... These primitive terms include the subsequence 9^k + 2*3^k + 1, k > 0, which yields A033934 when written in base 3.

Crossrefs

Cf. A267764 - A267769 for bases 4 through 9. The base-2 analog is A000302 = powers of 4.

Programs

  • Magma
    [n: n in [0..10^6] | IsSquare(Seqint(Intseq(n, 3)))]; // Vincenzo Librandi, Dec 28 2016
  • Mathematica
    Select[Range[0, 600000], IntegerQ@Sqrt@FromDigits@IntegerDigits[#, 3] &] (* Vincenzo Librandi Dec 28 2016 *)
  • PARI
    is(n,b=3,c=10)=issquare(subst(Pol(digits(n,b)),x,c))
    
  • Python
    A267763_list = [int(d,3) for d in (str(i**2) for i in range(10**6)) if max(d) < '3'] # Chai Wah Wu, Mar 12 2016
    
Showing 1-10 of 65 results. Next