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.

Previous Showing 21-25 of 25 results.

A226019 Primes whose binary reversal is a square.

Original entry on oeis.org

2, 19, 79, 149, 569, 587, 1237, 2129, 2153, 2237, 2459, 2549, 4129, 4591, 4657, 4999, 8369, 8999, 9587, 9629, 9857, 10061, 17401, 17659, 17737, 18691, 20149, 20479, 33161, 33347, 34631, 35117, 35447, 39023, 40427, 40709, 66403, 68539, 74707, 75703, 79063, 79333, 80071
Offset: 1

Views

Author

Alex Ratushnyak, May 23 2013

Keywords

Comments

The sequence of corresponding squares begins: 1, 25, 121, 169, 625, 841, 1369, 2209, 2401, 3025, 3481, 2809, 4225, 7921, ...
For n>1 the second and third most significant bits of a(n) are "0" because all odd squares are equal to 1 mod 8. - Andres Cicuttin, May 12 2016

Crossrefs

Subsequence of A204219. Cf. also A235027.

Programs

  • Mathematica
    Select[Table[Prime[j],{j,1,10000}],Element[Sqrt[FromDigits[Reverse[IntegerDigits[#,2]],2]],Integers]&] (* Andres Cicuttin, May 12 2016 *)
  • PARI
    isok(k) = isprime(k) && issquare(fromdigits(Vecrev(binary(k)), 2)); \\ Michel Marcus, Feb 19 2021
  • Python
    import math
    primes = []
    def addPrime(k):
      for p in primes:
        if k%p==0:  return
        if p*p > k:  break
      primes.append(k)
      r = 0
      p = k
      while k:
        r = r*2 + (k&1)
        k>>=1
      s = int(math.sqrt(r))
      if s*s == r:  print(p, end=', ')
    addPrime(2)
    addPrime(3)
    for i in range(5, 1000000000, 6):
      addPrime(i)
      addPrime(i+2)
    
  • Python
    from sympy import isprime
    A226019_list, i, j = [2], 0, 0
    while j < 2**34:
        p = int(format(j,'b')[::-1],2)
        if j % 2 and isprime(p):
            A226019_list.append(p)
        j += 2*i+1
        i += 1
    A226019_list = sorted(A226019_list) # Chai Wah Wu, Dec 20 2015
    
  • Python
    from sympy import integer_nthroot, primerange
    def ok(p): return integer_nthroot(int(bin(p)[:1:-1], 2), 2)[1]
    def aupto(lim): return [p for p in primerange(2, lim+1) if ok(p)]
    print(aupto(80071)) # Michael S. Branicky, Feb 19 2021
    

A362677 Primes whose reversal + 1 is a cube.

Original entry on oeis.org

7, 421, 827, 4733, 32831, 57571, 228301, 364751, 892079, 1932677, 2256713, 3684211, 4213591, 6751853, 7218259, 7887707, 8497033, 15720487, 19925251, 21055813, 28756943, 29547961, 47369149, 51881849, 55033973, 57954643, 59677001, 63062963, 74415157, 88535987
Offset: 1

Views

Author

Zhining Yang, Jul 03 2023

Keywords

Comments

From Jon E. Schoenfield, Jul 03 2023: (Start)
Equivalently, primes whose reversal is one less than the cube of a positive integer whose last digit is not a 1.
Since no prime starts or ends with a 0, reversing the prime will not change the number of digits, and since no prime consists only of 9's, adding 1 to its reversal will not change the number of digits, either, so the cube will have the same number of digits as the prime. Since the prime cannot begin with a 0, its reversal cannot end in 0, so the cube cannot end in 1 (and a cube ends in 1 if and only if its cube root ends in 1). Since cubes are less dense than primes, a reasonably efficient but simple way to search for all terms having at most D digits is to test each positive integer r < 10^(D/3) such that r mod 10 != 1: if the reversal of r^3 - 1 is a prime, then that prime is a term of the sequence. (End)

Examples

			421 is prime and reversal(421) + 1 = 124 + 1 = 125 = 5^3.
364751 is in the sequence because it is prime and reversal(364751) + 1 = 157463 + 1 = 157464 = 54^3.
		

Crossrefs

Programs

  • Mathematica
    Select[Prime@Range@1000000,IntegerQ@CubeRoot@(FromDigits@Reverse@IntegerDigits@#+1) &]
    r = Select[Range@300, Mod[#, 3] != 1 && Mod[#, 10] != 1 &];
    s = Sort@Select[FromDigits /@ Reverse /@ IntegerDigits@(r^3 - 1),PrimeQ]
    Select[Prime[Range[514*10^4]],IntegerQ[CubeRoot[1+IntegerReverse[#]]]&] (* Harvey P. Dale, Apr 03 2025 *)
  • Python
    from sympy import isprime
    s=[int(str(k**3-1)[::-1]) for k in range(1,301)if k%10!=1 and k%3!=1]
    t=[p for p in s if isprime(p)]
    t.sort
    print(t)

Extensions

a(18)-a(30) from Jon E. Schoenfield, Jul 03 2023

A087768 Minimal prime whose reversal is a multiple of n, or 0 if no such prime exists.

Original entry on oeis.org

2, 2, 3, 23, 5, 0, 7, 23, 0, 0, 11, 0, 19, 41, 0, 23, 43, 0, 59, 0, 0, 0, 29, 0, 521, 269, 0, 211, 457, 0, 13, 23, 0, 43, 53, 0, 47, 67, 0, 0, 349, 0, 103, 0, 0, 29, 257, 0, 89, 0, 0, 401, 109, 0, 0, 211, 0, 457, 449, 0, 397, 421, 0, 821, 523, 0, 431, 631, 0, 0, 17, 0, 37, 47, 0
Offset: 1

Views

Author

Zak Seidov, Oct 03 2003

Keywords

Comments

There are no primes whose reversal is a multiple of 3, 10, 11 (except 3 & 11).

Crossrefs

Cf. A007488.

Extensions

Corrected and extended by Ray Chandler, Oct 05 2003

A087769 Minimal prime whose reversal is a multiple of n-th prime.

Original entry on oeis.org

2, 3, 5, 7, 11, 19, 43, 59, 29, 457, 13, 47, 349, 103, 257, 109, 449, 397, 431, 17, 37, 97, 233, 653, 79, 101, 127, 701, 367, 197, 3863, 131, 1627, 379, 547, 151, 587, 1667, 433, 643, 617, 181, 191, 277, 887, 599, 3709, 1973, 809, 619, 239, 659, 1747, 1877, 1433
Offset: 1

Views

Author

Zak Seidov, Oct 03 2003

Keywords

Examples

			n=100, p(n)=541, minimal prime whose reversal is a multiple of 541 is 2801.
		

Crossrefs

Cf. A007488.

Programs

  • Mathematica
    Module[{nn=600,irp},irp=IntegerReverse/@Prime[Range[nn]];Table[ IntegerReverse[ SelectFirst[irp,IntegerQ[#/p]&]],{p,Prime[Range[60]]}]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Sep 26 2020 *)

A345956 Primes whose reverse is the square of a Fibonacci number.

Original entry on oeis.org

1297, 921241, 186331288599111530713519, 98866853184420632874393761586063024530467395043
Offset: 1

Views

Author

Tanya Khovanova, Jun 30 2021

Keywords

Examples

			The reverse of 1297 is 7921 = 89^2, where 89 is a Fibonacci number. Thus 1297 is in this sequence.
		

Crossrefs

Cf. A007488 (primes whose reversal is a square), A036797 (Iccanobif primes).

Programs

  • Mathematica
    Select[IntegerReverse/@(Fibonacci@Range@1000^2),PrimeQ] (* Giorgos Kalogeropoulos, Jun 30 2021 *)
  • PARI
    for(k=3,200,my(f=fibonacci(k)^2,fi=fromdigits(Vecrev(digits(f))));if(isprime(fi),print1(fi,", "))) \\ Hugo Pfoertner, Jun 30 2021
    
  • Python
    from sympy import fibonacci, isprime
    def rev(n): return int(str(n)[::-1])
    def auptok(klimit): return [t for t in (rev(fibonacci(k)**2) for k in range(3, klimit+1)) if isprime(t)]
    print(auptok(200)) # Michael S. Branicky, Jun 30 2021
Previous Showing 21-25 of 25 results.