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.

A089951 Numbers having the same leading decimal digits as their squares.

Original entry on oeis.org

0, 1, 10, 11, 12, 13, 14, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 895
Offset: 1

Views

Author

Reinhard Zumkeller, Jan 12 2004

Keywords

Comments

A000030(a(n)) = A002993(a(n)) = A000030(A000290(a(n))).

Examples

			895*895 = 801025, therefore 895 is a term: a(55)=895.
		

Crossrefs

Cf. A018834.
Cf. A144582. - Reinhard Zumkeller, Aug 17 2008
Cf. A000030, A002993, A000290, A256523 (subsequence).

Programs

  • Haskell
    a089951 n = a089951_list !! (n-1)
    a089951_list = [x | x <- [0..], a000030 x == a000030 (x ^ 2)]
    -- Reinhard Zumkeller, Apr 01 2015
  • Maple
    F:= proc(d) $10^d .. floor(sqrt(2)*10^d), $ ceil(sqrt(80)*10^d) .. 9*10^d - 1, $ ceil(sqrt(90)*10^d) .. 10^(d+1)-1 end proc:
    0, F(0), F(1), F(2), F(3); # Robert Israel, Mar 18 2015
  • Mathematica
    d[n_] := IntegerDigits[n]; Select[Range[895],
    First[d[#]] == First[d[#^2]] &] (* Jayanta Basu, Jun 03 2013 *)
  • PARI
    a(n)={my(v = [1, sqrt(80), sqrt(90)], w=[(k)->10^k * ((sqrt(2) - 1))\1 + 1, (k)->9 * 10^k - ceil(sqrt(80) * 10^k), (k)->10 * 10^k - ceil(sqrt(90) * 10^k)],i = 1,k = 0); if(n==1, 0, n--; while(n>w[i](k), n-=w[i](k); i++; if(i == 4, i = 1; k++)); ceil(v[i]*10^k)+n-1)} \\ David A. Corneth, Feb 26 2015
    
  • PARI
    isok(n) = (n == 0) || (digits(n)[1] == digits(n^2)[1]); \\ Michel Marcus, Mar 18 2015
    

Formula

A number n is in the sequence iff n = 0 or n/10^floor(log_10(n)) lies in one of the half-open intervals [1, sqrt(2)), [sqrt(80), 9) or [sqrt(90), 10). - David W. Wilson, May 29 2008

A144582 Numbers having the same leading decimal digit as their cube.

Original entry on oeis.org

0, 1, 10, 11, 12, 28, 29, 32, 33, 34, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287
Offset: 1

Views

Author

Reinhard Zumkeller, Aug 17 2008

Keywords

Comments

For k > 0, write k = s * 10^t, 1 <= s < 10, then k is a term if and only if s is in [1, 2^(1/3)) U (20^(1/3), 3) U (30^(1/3), 40^(1/3)) U (30^(2/3), 10). - Jianing Song, Dec 26 2022

Examples

			a(13)=99 and 970299=99^3 start both with 9.
		

Crossrefs

Cf. A000030, A002994, A000578, A089951, A256523 (subsequence).

Programs

  • Haskell
    a144582 n = a144582_list !! (n-1)
    a144582_list = [x | x <- [0..], a000030 x == a000030 (x ^ 3)]
    -- Reinhard Zumkeller, Apr 01 2015
  • Mathematica
    Select[Range[0,300],First[IntegerDigits[#]]== First[IntegerDigits[#^3]]&]  (* Harvey P. Dale, Mar 14 2011 *)
  • PARI
    isok(n) = (n == 0) || (digits(n)[1] == digits(n^3)[1]); \\ Michel Marcus, Mar 18 2015
    

Formula

A000030(a(n)) = A002994(a(n)) = A000030(A000578(a(n))).
Showing 1-2 of 2 results.