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.

A019547 Squares which are a decimal concatenation of two or more squares.

Original entry on oeis.org

49, 100, 144, 169, 361, 400, 441, 900, 1225, 1369, 1444, 1600, 1681, 1936, 2500, 3249, 3600, 4225, 4900, 6400, 8100, 9025, 9409, 10000, 10404, 11025, 11449, 11664, 12100, 12544, 14161, 14400, 14641, 15625, 16641, 16900, 19044, 19600, 22500, 25600, 28900
Offset: 1

Views

Author

R. Muller

Keywords

Comments

0 counts as a square here.

Examples

			1369 is a term as it can be partitioned as 1, 36 and 9. 1444 is a term as it can be partitioned as 1, 4, 4, 4. Again, 100 is 1, 0, 0.
		

References

  • L. Widmer, Construction of Elements of the Smarandache Square-Partial-Digital Sequence, Smarandache Notions Journal, Vol. 8, No. 1-2-3, 1997, 145-146.

Crossrefs

Programs

  • Mathematica
    r[n_, d_] := Catch@Block[{z = Length@d, t}, z < 1 || Do[If[IntegerQ@ Sqrt@ (t = FromDigits@Take[d, i]) && t < n && r[n, Take[d, i - z]], Throw@ True], {i, z}]]; Select[Range[4, 10^4]^2, r[#, IntegerDigits@ #] &] (* Giovanni Resta, Apr 30 2013 *)
  • 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*r for r in range(180) if ok(r*r, 1)]) # Michael S. Branicky, Jul 10 2021

Formula

n^2 < a(n) < 100n^2. - Charles R Greathouse IV, Sep 19 2012
a(n) = A128783(n)^2. - Michael S. Branicky, Jul 10 2021

Extensions

More terms from Christian N. K. Anderson, Apr 30 2013

A048653 Numbers k such that the decimal digits of k^2 can be partitioned into two or more nonzero squares.

Original entry on oeis.org

7, 12, 13, 19, 21, 35, 37, 38, 41, 44, 57, 65, 70, 107, 108, 112, 119, 120, 121, 125, 129, 130, 190, 191, 204, 205, 209, 210, 212, 223, 253, 285, 305, 306, 315, 342, 343, 345, 350, 369, 370, 379, 380, 408, 410, 413, 440, 441, 475, 487, 501, 538, 570, 642, 650
Offset: 1

Views

Author

Keywords

Examples

			12 is present because 12^2=144 can be partitioned into three squares 1, 4 and 4.
108^2 = 11664 = 1_16_64, 120^2 = 14400 = 1_4_400, so 108 and 120 are in the sequence.
		

Crossrefs

Cf. A048646, A048375, A010052, A000290; subsequence of A128783.

Programs

  • Haskell
    a048653 n = a048653_list !! (n-1)
    a048653_list = filter (f . show . (^ 2)) [1..] where
       f zs = g (init $ tail $ inits zs) (tail $ init $ tails zs)
       g (xs:xss) (ys:yss)
         | h xs      = h ys || f ys || g xss yss
         | otherwise = g xss yss
         where h ds = head ds /= '0' && a010052 (read ds) == 1
       g   = False
    -- Reinhard Zumkeller, Oct 11 2011
    
  • Mathematica
    (* This non-optimized program is not suitable to compute a large number of terms. *) split[digits_, pos_] := Module[{pos2}, pos2 = Transpose[{Join[ {1}, Most[pos+1]], pos}]; FromDigits[Take[digits, {#[[1]], #[[2]]}]]& /@ pos2]; sel[n_] := Module[{digits, ip, ip2, accu, nn}, digits = IntegerDigits[n^2]; ip = IntegerPartitions[Length[digits]]; ip2 = Flatten[ Permutations /@ ip, 1]; accu = Accumulate /@ ip2; nn = split[ digits, #]& /@ accu; SelectFirst[nn, Length[#]>1 && Flatten[ IntegerDigits[#] ] == digits && AllTrue[#, #>0 && IntegerQ[Sqrt[#]]&]&] ]; k = 1; Reap[Do[If[(s = sel[n]) != {}, Print["a(", k++, ") = ", n, " ", n^2, " ", s]; Sow[n]], {n, 1, 10^4}]][[2, 1]] (* Jean-François Alcover, Sep 28 2016 *)
  • 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 d[i] != '0' and issquare(int(d[:i])) and ok(int(d[i:]), c+1):
                return True
        return False
    def aupto(lim): return [r for r in range(lim+1) if ok(r*r, 1)]
    print(aupto(650)) # Michael S. Branicky, Jul 10 2021

Extensions

Corrected and extended by Naohiro Nomoto, Sep 01 2001
Definition clarified by Harvey P. Dale, May 09 2021

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.