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-2 of 2 results.

A275028 Squares whose digital rotation is also a square.

Original entry on oeis.org

1, 121, 196, 529, 625, 961, 6889, 10201, 69169, 1002001, 1022121, 1212201, 5221225, 100020001, 100220121, 109181601, 121022001, 522808225, 602555209, 10000200001, 10002200121, 10020210201, 10201202001, 12100220001, 62188888129, 1000002000001
Offset: 1

Views

Author

Seiichi Manyama, Nov 12 2016

Keywords

Comments

From Jon E. Schoenfield, Nov 13 2016: (Start)
It is assumed that the rotation changes each digit 6 to a 9 and vice versa, and that the digits 0, 1, 2, 5, and 8 are unchanged by the rotation, as is the case with a seven-segment display in which the digits are formed basically as follows:
| | | | | || | | | || |_|
|| | | | | | || | || _|
(End)
Sequence is infinite since (10^m+1)^2 for m>0 are terms. Leading zeros after rotation are not allowed, as otherwise 10^m would be terms. All terms start and end with digits 1, 5, 6 or 9. - Chai Wah Wu, Apr 09 2024

Examples

			961 becomes 196 under such a rotation.
		

Crossrefs

Cf. A178316.

Programs

  • Mathematica
    Select[Range[10^6]^2, If[Or[IntersectingQ[#, {3, 4, 7}], Last@# == 0], False, IntegerQ@ Sqrt@ FromDigits[Reverse@ # /. {6 -> 9, 9 -> 6}]] &@ IntegerDigits@ # &] (* Michael De Vlieger, Nov 14 2016 *)
  • Python
    from itertools import count, islice
    from sympy.ntheory.primetest import is_square
    def A275028_gen(): # generator of terms
        r, t = ''.maketrans('69','96'), set('0125689')
        for l in count(1):
            if l%10:
                m = l**2
                if set(s:=str(m)) <= t and is_square(int(s[::-1].translate(r))):
                    yield m
    A275028_list = list(islice(A275028_gen(),10)) # Chai Wah Wu, Apr 09 2024

A370447 Palindromic prime numbers that consist only of the digits {0,1,6,8,9} and which remain palindromic primes when their digits are rotated by 180 degrees.

Original entry on oeis.org

11, 101, 181, 16661, 18181, 19991, 1008001, 1160611, 1180811, 1190911, 1688861, 1880881, 1881881, 1988891, 100111001, 100888001, 101616101, 101919101, 106111601, 106191601, 108101801, 109111901, 109161901, 110111011, 111010111, 111181111, 116010611, 116696611
Offset: 1

Views

Author

Jean-Marc Rebert, Feb 18 2024

Keywords

Comments

10886968801 is the least palindromic prime of this sequence for which the set of digits is {0,1,6,8,9}.
Terms must start and end with digit 1 and be of odd length for n > 1. - Michael S. Branicky, Feb 19 2024

Examples

			16661 becomes 19991 under such a rotation, and both are palindromic primes.
		

Crossrefs

Subsequence of palindromes in A007597.

Programs

  • PARI
    rot(u)=my(v=[]);for(i=1,#u,my(x=u[i]);if(x==6,v=concat(9,v),x==9,v=concat(6,v),vecsearch([0,1,8],x)>0,v=concat(x,v)));v
    is(x)=my(u=digits(x),su=Set(u));if(setintersect(su,Set([0,1,6,8,9]))!=su||!isprime(x)||Vecrev(u)!=u,return(0));my(y=fromdigits(rot(u)));return(isprime(y))
    
  • Python
    from sympy import isprime
    from itertools import product, count, islice
    def flip180(s): return s[::-1].translate({54:57, 57:54})
    def agen(): # generator of terms
        yield 11
        for digits in count(3, 2):
            for rest in product("01689", repeat=digits//2-1):
                for mid in "01689":
                    s = "".join(("1",)+rest+(mid,)+rest[::-1]+("1",))
                    if isprime(t:=int(s)) and isprime(int(flip180(s))):
                        yield t
    print(list(islice(agen(), 28))) # Michael S. Branicky, Feb 19 2024
Showing 1-2 of 2 results.