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

A048646 Primes p such that the decimal digits of p^2 can be partitioned into two or more nonzero squares.

Original entry on oeis.org

7, 13, 19, 37, 41, 107, 191, 223, 379, 487, 997, 1063, 1093, 1201, 1301, 1907, 2029, 3019, 3169, 3371, 5081, 5099, 5693, 6037, 9041, 9619, 9721, 9907, 10007, 11681, 12227, 12763, 17393, 18493, 19013, 19213, 19219, 21059, 21157, 21193, 25931
Offset: 1

Views

Author

Keywords

Examples

			7 is present because 7^2=49 can be partitioned into two squares 4 and 9; 13^2 = 169 = 16_9; 37^2 = 1369 = 1_36_9.
997^2 = 994009 = 9_9_400_9, 1063^2 = 1129969 = 1_12996_9, 997 and 1063 are primes, so 997 and 1063 are in the sequence.
		

Crossrefs

Cf. A048375.
Cf. A010051, intersection of A048653 and A000040.

Programs

  • Haskell
    a048646 n = a048646_list !! (n-1)
    a048646_list = filter ((== 1) . a010051') a048653_list
    -- Reinhard Zumkeller, Apr 17 2015
    
  • Python
    from math import isqrt
    from sympy import primerange
    def issquare(n): return isqrt(n)**2 == n
    def ok(n, c):
        if n%10 in {2, 3, 7, 8}: return False
        if issquare(n) and c > 1: return True
        d = str(n)
        for i in range(1, len(d)):
            if d[i] != '0' and issquare(int(d[:i])) and ok(int(d[i:]), c+1):
                return True
        return False
    def aupto(lim): return [p for p in primerange(1, lim+1) if ok(p*p, 1)]
    print(aupto(25931)) # Michael S. Branicky, Jul 10 2021

Extensions

Corrected and extended by Naohiro Nomoto, Sep 01 2001
"Nonzero" added to definition by N. J. A. Sloane, May 08 2021

A128783 Numbers whose square is a nontrivial concatenation of other squares.

Original entry on oeis.org

7, 10, 12, 13, 19, 20, 21, 30, 35, 37, 38, 40, 41, 44, 50, 57, 60, 65, 70, 80, 90, 95, 97, 100, 102, 105, 107, 108, 110, 112, 119, 120, 121, 125, 129, 130, 138, 140, 150, 160, 170, 180, 190, 191, 200, 201, 204, 205, 209, 210, 212, 220, 223, 230, 240, 250
Offset: 1

Views

Author

Jonathan R. Love (japanada11(AT)yahoo.ca), Apr 07 2007

Keywords

Comments

a(n) = sqrt(A019547(n)); the sequence A019547 gives the squares themselves and this sequence gives the numbers whose squares yield the numbers in A019547. All multiples of 10 are included, because for any value of x, (x*10)^2 = x^2*100, which is x^2 followed by two zeros. Every digit except 6 is used as the last digit of a number in this sequence before 50. 6 is not used as the last digit of a number in this sequence until 306.

Examples

			13 is included because 13^2 = 169, which includes 16 and 9, two perfect squares.
		

Crossrefs

Cf. A019547.
Cf. A010052, A000290; A048653 is a subsequence.

Programs

  • Haskell
    a128783 n = a128783_list !! (n-1)
    a128783_list = filter (f . show . (^ 2)) [1..] where
       f zs = g (init $ tail $ inits zs) (tail $ init $ tails zs)
       g (xs:xss) (ys:yss)
         | a010052 (read xs) == 1 = a010052 (read ys) == 1 || f ys || g xss yss
         | otherwise              = g xss yss
       g   = False
    -- Reinhard Zumkeller, Oct 11 2011
    
  • Python
    from math import isqrt
    def issquare(n): return isqrt(n)**2 == n
    def ok(n, c):
        if n%10 in { 2, 3, 7, 8}: return False
        if issquare(n) and c > 1: return True
        d = str(n)
        for i in range(1, len(d)):
            if issquare(int(d[:i])) and ok(int(d[i:]), c+1): return True
        return False
    print([r for r in range(251) if ok(r*r, 1)]) # Michael S. Branicky, Jul 10 2021

Extensions

Missing terms 205 and 209 inserted by Reinhard Zumkeller, Oct 11 2011

A344045 Primes p such that the decimal digits of p^2 can be partitioned into two or more squares.

Original entry on oeis.org

7, 13, 19, 37, 41, 97, 107, 191, 223, 379, 397, 487, 509, 701, 997, 1049, 1063, 1093, 1201, 1301, 1801, 1907, 2011, 2029, 3019, 3169, 3319, 3371, 3767, 4013, 4451, 5009, 5011, 5081, 5099, 5693, 6037, 6397, 7001, 8009, 9041, 9521, 9619, 9721, 9907, 10007
Offset: 1

Views

Author

Harvey P. Dale, May 09 2021

Keywords

Comments

Similar to A048646 except that here zeros are permitted as squares.

Examples

			97 is a term because 97 is a prime and 97^2 = 9409 which can be partitioned into 9, 4, 0, and 9, each of which is a square.
		

Crossrefs

Programs

  • Mathematica
    tmsQ[n_]:=Total[Boole[AllTrue[Sqrt[#],IntegerQ]&/@Rest[Table[FromDigits/@ TakeList[IntegerDigits[n^2],q],{q,Flatten[Permutations/@ IntegerPartitions[ IntegerLength[ n^2]],1]}]]]]>0; Select[Prime[ Range[ 3000]],tmsQ]
Showing 1-3 of 3 results.