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 17 results. Next

A272677 Number of digits in A018796 - number of digits in n.

Original entry on oeis.org

0, 0, 1, 1, 0, 2, 1, 2, 1, 0, 1, 2, 1, 2, 1, 2, 0, 2, 2, 1, 2, 2, 1, 2, 2, 0, 2, 2, 1, 2, 2, 2, 1, 2, 2, 3, 0, 2, 2, 2, 1, 3, 2, 2, 1, 3, 2, 2, 1, 0, 2, 2, 1, 2, 2, 3, 2, 1, 3, 2, 2, 3, 1, 3, 0, 2, 3, 1, 2, 3, 2, 3, 1, 2, 3, 2, 3, 2, 1, 2, 3, 0, 2, 3, 1, 3, 2, 3, 2, 3
Offset: 0

Views

Author

Keywords

Comments

These are the numbers d mentioned in Robert Israel's comment in A018851.

Crossrefs

A018851 a(n)^2 is smallest square beginning with n.

Original entry on oeis.org

0, 1, 5, 6, 2, 23, 8, 27, 9, 3, 10, 34, 11, 37, 12, 39, 4, 42, 43, 14, 45, 46, 15, 48, 49, 5, 51, 52, 17, 54, 55, 56, 18, 58, 59, 188, 6, 61, 62, 63, 20, 203, 65, 66, 21, 213, 68, 69, 22, 7, 71, 72, 23, 73, 74, 235, 75, 24, 241, 77, 78, 247, 25, 251, 8, 81, 257, 26, 83, 263, 84, 267, 27
Offset: 0

Views

Author

Keywords

Comments

The following discussion is based on comments from David A. Corneth, Robert Israel, N. J. A. Sloane, and Chai Wah Wu. (Start)
As the graph shows, the points belong to various "curves". For each n there is a value d = d(n) such that n*10^d <= a(n)^2 < (n+1)*10^d, and so on this curve, a(n) ~ sqrt(n)*10^(d/2). The values of d(n) are given in A272677.
For a given n, d can range from 0 (if n is a square) to d_max, where it appears that d_max approx. equals 3 + floor( log_10(n/25) ). The successive points where d_max increases are given in A272678, and that entry contains more precise conjectures about the values.
For example, in the range 2600 = A272678(5) <= n < 25317 = A272678(6), d_max is 5. This is the upper curve in the graph that is seen if the "graph" button is clicked, and on this curve a(n) is about sqrt(n)*10^(5/2). (End)

Crossrefs

Cf. A018796 (the squares), A272677, A272678.
A265432 is a more complicated sequence in the same spirit.

Programs

  • Maple
    f:= proc(n) local d,m;
      for d from 0 do
        m:= ceil(sqrt(10^d*n));
        if m^2 < 10^d*(n+1) then return m fi
      od
    end proc:
    map(f, [$1..100]); # Robert Israel, Jul 26 2015
  • PARI
    a(n)=k=1; while(k,d=digits(k^2); D=digits(n); if(#D<=#d,c=1; for(i=1,#D,if(D[i]!=d[i],c=0;break));if(c,return(k)));k++)
    vector(100,n,a(n)) \\ Derek Orr, Jul 26 2015

Formula

a(n) >= sqrt(n), for all n >= 0 with equality when n is a square. - Derek Orr, Jul 26 2015

Extensions

Added initial 0. - N. J. A. Sloane, May 21 2016
Comments revised by N. J. A. Sloane, Jul 17 2016

A265432 a(n) = smallest k with concat(1,k) and concat(n,k) both square numbers.

Original entry on oeis.org

225, 6, 1025, 6, 225, 9937257544619140625, 80625, 225, 19025, 14797831640625, 5625, 89450791534674072265625, 96, 69, 44, 21, 1993672119140625, 2002541101386962890625, 225, 6, 8734765625, 99758030615478515625, 5625, 863225, 80625, 6, 40625, 225, 890625, 158764150390625
Offset: 0

Views

Author

Keywords

Comments

k must be a positive integer (and of course cannot begin with 0). - N. J. A. Sloane, May 19 2016
Every term is a member of A272671, by definition. Certainly every term of A272671 which is a power of 100 times an earlier term of A272671 (such as 600, 2100, 4400) will not appear, by the "smallest k" condition. Does every other term of A272671 (that is, the terms of A272684) eventually appear? See A272685 and A273369 for the first appearance of these terms. - Nathan Fox, Brooke Logan, and N. J. A. Sloane, May 23 2016

Examples

			a(0) = 225 because 1225 is a square as is (0)225. (In other words, 225 is the first term in A272672 that is itself a square). - _N. J. A. Sloane_, May 21 2016
a(2) = 1025 because concat(1,1025) = 11025 = 105^2 and concat(2,1025) = 21025 = 145^2.
		

Crossrefs

Cf. A045855, A272671, A018796, A272684, A272685 and A273369 (smallest inverse).
For records see A272674, A272675.
For square roots referred to in definition see A272682, A272683.
A018851 is a simpler sequence in the same spirit.

Programs

  • Mathematica
    << Combinatorica`
    A265432[0] = 225;
    A265432[1] = 6;
    A265432[n_] := Block[{x = {-1, 1, 0, 1}[[Mod[n, 4, 1]]], d = Infinity, l, i}, While[d > Sqrt[10.0^(x - 1)] (Sqrt[10.0 n + 1] - Sqrt[11.0]), x++; d = Infinity; l = Divisors[((n - 1) 10^x)/4]; i = BinarySearch[l, 0.5 Sqrt[(n + 1) 10.0^x - 1] - 0.5 Sqrt[2*10.0^x - 1]]; If[i <= Length@l, d = 2*l[[i + 1/2]]]]; (((n - 1) 10^x - d^2)/(2 d))^2 - 10^x] (* Davin Park, Apr 11 2017 *)

A018797 Smallest cube that begins with n.

Original entry on oeis.org

0, 1, 27, 343, 4096, 512, 64, 729, 8, 9261, 1000, 110592, 125, 1331, 140608, 15625, 166375, 1728, 185193, 19683, 205379, 216, 226981, 238328, 24389, 250047, 262144, 27, 287496, 29791, 300763, 314432, 32768, 3375, 343, 35937, 3652264, 373248
Offset: 0

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_] := For[idn = IntegerDigits[n]; k = 1, True, k++, idk = IntegerDigits[k^3]; If[Length[idn] <= Length[idk], If[idk[[1 ;; Length[idn]]] == idn, Return[k^3]]]]; Table[an = a[n]; Print["a(", n, ") = ", an]; an, {n, 1, 1000}] (* Jean-François Alcover, Mar 13 2016 *)
    id[n_]:=With[{idn=IntegerDigits[n]},idn==Take[IntegerDigits[#], Length[ idn]]&]; With[{c=Range[0,250]^3},Table[SelectFirst[c,id[k]],{k,0,40}]]//Quiet (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Dec 08 2018 *)
  • Python
    for n in range(1, 10**3):
      for k in range(10**3):
        if str(k**3).startswith(str(n)):
          print(k**3, end=', ')
          break
      n += 1 # Derek Orr, Aug 03 2014

Formula

a(n) = A018852(n)^3. - Seiichi Manyama, Jan 30 2017

Extensions

Added initial 0. - Seiichi Manyama, Jan 30 2017

A030666 Smallest nontrivial extension of n which is a square.

Original entry on oeis.org

16, 25, 36, 49, 529, 64, 729, 81, 900, 100, 1156, 121, 1369, 144, 1521, 169, 1764, 1849, 196, 2025, 2116, 225, 2304, 2401, 256, 2601, 2704, 289, 2916, 3025, 3136, 324, 3364, 3481, 35344, 361, 3721, 3844, 3969, 400, 41209, 4225, 4356, 441
Offset: 1

Views

Author

Keywords

Comments

A trivial extension would mean appending no digits at all when n is already a square. With trivial extensions allowed, this sequence becomes A018796.

Examples

			80 is not a perfect square, but 81 = 9^2, so a(8) = 81.
Although 9 is already a square, we need to append at least one digit. However, none of 90, 91, 92, ..., 99 are squares. Then we try 900 = 30^2, so a(9) = 900.
		

Crossrefs

See A264604 for another version (first differs at a(9)).

Programs

  • Maple
    # Program which computes 20000 terms, from N. J. A. Sloane, Nov 24 2015
    for b from 1 to 20000 do
    sw1:=-1:
    for p from 1 to 6 do
    bp:=b*10^p;
    for i from 0 to 10^p-1 do
    if issqr(bp+i) then lprint(b,bp+i); sw1:=1; break; fi;
                           od:
    if sw1 > 0 then break; fi;
                     od:
    if sw1 < 0 then lprint("failed at b = ",b); fi;
                          od:
  • Python
    from gmpy2 import isqrt
    def A030666(n):
        d, nd = 10, 10*n
        while True:
            x = (isqrt(nd-1)+1)**2
            if x < nd+d:
                return int(x)
            d *= 10
            nd *= 10 # Chai Wah Wu, May 24 2016

Formula

a(n) = A030667(n)^2.

A272679 a(n)^2 is the smallest square whose binary expansion begins with the binary expansion of n.

Original entry on oeis.org

0, 1, 2, 5, 2, 9, 5, 11, 4, 3, 9, 19, 5, 21, 15, 11, 4, 33, 6, 25, 9, 13, 19, 39, 7, 5, 29, 21, 15, 61, 11, 45, 8, 23, 33, 67, 6, 49, 35, 25, 9, 73, 13, 53, 107, 19, 77, 39, 79, 7, 10, 81, 29, 83, 59, 21, 15, 43, 61, 87, 11, 89, 63, 45, 8, 129, 23, 93, 33, 47
Offset: 0

Views

Author

N. J. A. Sloane, May 22 2016

Keywords

Examples

			a(10)=9, because 9^2 = 81 = 1010001_2 begins with 1010 = 10_2.
		

References

  • Allan C. Wechsler, posting to math-fun mailing list May 22 2016.

Crossrefs

Programs

  • Python
    from gmpy2 import isqrt
    def A272679(n):
        if n == 0:
            return 0
        else:
            d, nd = 1, n
            while True:
                x = isqrt(nd-1)+1
                if x**2 < nd+d:
                    return int(x)
                d *= 2
                nd *= 2 # Chai Wah Wu, May 22 2016

Extensions

More terms from Chai Wah Wu, May 22 2016

A077346 Triangle in which n-th row contains n smallest squares beginning with n.

Original entry on oeis.org

1, 25, 225, 36, 324, 361, 4, 49, 400, 441, 529, 576, 5041, 5184, 5329, 64, 625, 676, 6084, 6241, 6400, 729, 784, 7056, 7225, 7396, 7569, 7744, 81, 841, 8100, 8281, 8464, 8649, 8836, 80089, 9, 900, 961, 9025, 9216, 9409, 9604, 9801, 90000
Offset: 1

Views

Author

Amarnath Murthy, Nov 05 2002

Keywords

Comments

A018796 contains initial terms of rows. Subsidiary sequence: There can be a rearrangement of squares in groups so that the n-th group contains n squares beginning with n and not occurring earlier. E.g. the initial term of row 25 would be 256 and not 25.

Examples

			Triangle begins:
    1;
   25, 225;
   36, 324,  361;
    4,  49,  400,  441;
  529, 576, 5041, 5184, 5329;
  ...
		

Crossrefs

Programs

  • Maple
    g:= proc(n,d)
        local i,r;
        r:= ilog10(n)+1;
        seq(i^2, i = ceil(sqrt(n*10^(d-r))) .. ceil(sqrt((n+1)*10^(d-r)))-1)
    end proc:
    f:= proc(n)
       local R,count,v,d;
       count:= 0; R:= NULL;
       for d from 1 + ilog10(n) do
         v:= g(n,d);
         R:= R,v;
         count:= count + nops([v]);
         if count >= n then return R[1..n] fi
       od
    end proc:
    f(1):= 1:
    for i from 1 to 10 do f(i) od; # Robert Israel, Jan 28 2025
  • PARI
    row(n) = my(list=List(), k=1); while (#list != n, if (strsplit(Str(k^2), Str(n))[1] == "", listput(list, k^2)); k++); Vec(list); \\ Michel Marcus, Feb 08 2023

Extensions

More terms from Michel Marcus, Feb 08 2023

A077347 Final terms of rows of A077346.

Original entry on oeis.org

1, 225, 361, 441, 5329, 6400, 7744, 80089, 90000, 101124, 112896, 122500, 135424, 145924, 157609, 165649, 179776, 1806336, 1901641, 2013561, 2114116, 2220100, 2325625, 2427364, 2528100, 2637376, 2742336, 2845969, 2951524, 3059001
Offset: 1

Views

Author

Amarnath Murthy, Nov 05 2002

Keywords

Comments

a(n) = n-th square beginning with n. A018796 contains initial terms of rows. Subsidiary sequence: There can be a rearrangement of squares in groups so that the n-th group contains n squares beginning with n and not occurring earlier. E.g., the initial term of row 25 would be 256 and not 25 and accordingly the final terms would differ.

Crossrefs

Programs

  • Maple
    startsWith := proc(n,dig) local nshft ; nshft := n ; while nshft > dig do nshft := floor(nshft/10) ; od ; if dig = nshft then RETURN(true) ; else RETURN(false) ; fi ; end: A077347 := proc(n) local candid,c; candid := 1 ; for c from 1 to n do while not startsWith(candid^2,n) do candid := candid+1 ; od ; if c = n then RETURN(candid^2) ; fi ; candid := candid+1 ; od ; end: for n from 1 to 50 do printf("%a,",A077347(n)) ; od ; # R. J. Mathar, Nov 12 2006

Extensions

More terms from R. J. Mathar, Nov 12 2006

A077349 a(n) = A077347(n)^(1/2).

Original entry on oeis.org

1, 15, 19, 21, 73, 80, 88, 283, 300, 318, 336, 350, 368, 382, 397, 407, 424, 1344, 1379, 1419, 1454, 1490, 1525, 1558, 1590, 1624, 1656, 1687, 1718, 1749, 1779, 1806, 1836, 1865, 1895, 1918, 1949, 6165, 6247, 6326, 6409, 6487, 6565, 6641, 6720, 6795, 6868, 6943, 7013, 7089
Offset: 1

Views

Author

Amarnath Murthy, Nov 05 2002

Keywords

Crossrefs

Main diagonal of A077348.

Programs

Extensions

a(8) onwards from Andrew Howroyd, Dec 11 2024

A077348 a(n) = A077346(n)^(1/2).

Original entry on oeis.org

1, 5, 15, 6, 18, 19, 2, 7, 20, 21, 23, 24, 71, 72, 73, 8, 25, 26, 78, 79, 80, 27, 28, 84, 85, 86, 87, 88, 9, 29, 90, 91, 92, 93, 94, 283, 3, 30, 31, 95, 96, 97, 98, 99, 300, 10, 32, 33, 100, 101, 102, 103, 104, 317, 318, 34, 105, 106, 107, 108, 109, 332, 333, 334, 335, 336
Offset: 1

Views

Author

Amarnath Murthy, Nov 05 2002

Keywords

Examples

			Triangle begins:
   1;
   5, 15;
   6, 18, 19;
   2,  7, 20, 21;
  23, 24, 71, 72, 73;
  ...
		

Crossrefs

Programs

  • PARI
    row(n) = my(list=List(), k=1); while (#list != n, if (strsplit(Str(k^2), Str(n))[1] == "", listput(list, k)); k++); Vec(list); \\ Michel Marcus, Feb 08 2023

Extensions

More terms from Michel Marcus, Feb 08 2023
Showing 1-10 of 17 results. Next