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

A008851 Congruent to 0 or 1 mod 5.

Original entry on oeis.org

0, 1, 5, 6, 10, 11, 15, 16, 20, 21, 25, 26, 30, 31, 35, 36, 40, 41, 45, 46, 50, 51, 55, 56, 60, 61, 65, 66, 70, 71, 75, 76, 80, 81, 85, 86, 90, 91, 95, 96, 100, 101, 105, 106, 110, 111, 115, 116, 120, 121, 125, 126, 130, 131, 135, 136, 140, 141, 145, 146, 150, 151
Offset: 1

Views

Author

Keywords

Comments

Numbers k that have the same last digit as k^2.

References

  • L. E. Dickson, History of the Theory of Numbers, I, p. 459.

Crossrefs

Programs

  • Haskell
    a008851 n = a008851_list !! (n-1)
    a008851_list = [10*n + m | n <- [0..], m <- [0,1,5,6]]
    -- Reinhard Zumkeller, Jul 27 2011
    
  • Magma
    [n: n in [0..200] | n mod 5 in {0, 1}]; // Vincenzo Librandi, Nov 17 2014
  • Maple
    a[0]:=0:a[1]:=1:for n from 2 to 100 do a[n]:=a[n-2]+5 od: seq(a[n], n=0..61); # Zerinvary Lajos, Mar 16 2008
  • Mathematica
    Select[Range[0, 151], MemberQ[{0, 1}, Mod[#, 5]] &] (* T. D. Noe, Mar 31 2013 *)
  • PARI
    a(n) = 5*(n\2)+bitand(n,1); /* Joerg Arndt, Mar 31 2013 */
    
  • PARI
    a(n) = floor((5/3)*floor(3*(n-1)/2)); /* Joerg Arndt, Mar 31 2013 */
    

Formula

a(n) = 5*n - a(n-1) - 9, n >= 2. - Vincenzo Librandi, Nov 18 2010 [Corrected for offset by David Lovler, Oct 10 2022]
G.f.: x^2*(1+4*x) / ( (1+x)*(x-1)^2 ). - R. J. Mathar, Oct 07 2011
a(n+1) = Sum_{k>=0} A030308(n,k)*A146523(k). - Philippe Deléham, Oct 17 2011
a(n) = floor((5/3)*floor(3*(n-1)/2)). - Clark Kimberling, Jul 04 2012
a(n) = (10*n - 13 - 3*(-1)^n)/4. - Robert Israel, Nov 17 2014 [Corrected by David Lovler, Sep 21 2022]
E.g.f.: 4 + ((10*x - 13)*exp(x) - 3*exp(-x))/4. - David Lovler, Sep 11 2022
Sum_{n>=2} (-1)^n/a(n) = sqrt(1+2/sqrt(5))*Pi/10 + log(phi)/(2*sqrt(5)) + log(5)/4, where phi is the golden ratio (A001622). - Amiram Eldar, Oct 12 2022

Extensions

Offset corrected by Reinhard Zumkeller, Jul 27 2011

A018834 Numbers k such that the decimal expansion of k^2 contains k as a substring.

Original entry on oeis.org

0, 1, 5, 6, 10, 25, 50, 60, 76, 100, 250, 376, 500, 600, 625, 760, 1000, 2500, 3760, 3792, 5000, 6000, 6250, 7600, 9376, 10000, 14651, 25000, 37600, 50000, 60000, 62500, 76000, 90625, 93760, 100000, 109376, 250000, 376000, 495475, 500000, 505025
Offset: 1

Views

Author

Keywords

Examples

			25^2 = 625 which contains 25.
3792^2 = 14_3792_64, 14651^2 = 2_14651_801.
		

Crossrefs

Cf. A000290. Supersequence of A029943.
Cf. A018826 (base 2), A018827 (base 3), A018828 (base 4), A018829 (base 5), A018830 (base 6), A018831 (base 7), A018832 (base 8), A018833 (base 9).
Cf. A029942 (cubes), A075904 (4th powers), A075905 (5th powers).

Programs

  • Haskell
    import Data.List (isInfixOf)
    a018834 n = a018834_list !! (n-1)
    a018834_list = filter (\x -> show x `isInfixOf` show (x^2)) [0..]
    -- Reinhard Zumkeller, Jul 27 2011
    
  • Mathematica
    Select[Range[510000], MemberQ[FromDigits /@ Partition[IntegerDigits[#^2], IntegerLength[#], 1], #] &] (* Jayanta Basu, Jun 29 2013 *)
    Select[Range[0,510000],StringPosition[ToString[#^2],ToString[#]]!={}&] (* Ivan N. Ianakiev, Oct 02 2016 *)
  • Python
    from itertools import count, islice
    def A018834_gen(startvalue=0): # generator of terms >= startvalue
        return filter(lambda n:str(n) in str(n**2), count(max(startvalue,0)))
    A018834_list = list(islice(A018834_gen(),20)) # Chai Wah Wu, Apr 04 2023

A086457 Both n and n^2 have the same initial digit and also n and n^2 have the same final digit when expressed in base 10.

Original entry on oeis.org

0, 1, 10, 11, 95, 96, 100, 101, 105, 106, 110, 111, 115, 116, 120, 121, 125, 126, 130, 131, 135, 136, 140, 141, 895, 896, 950, 951, 955, 956, 960, 961, 965, 966, 970, 971, 975, 976, 980, 981, 985, 986, 990, 991, 995, 996, 1000, 1001, 1005, 1006, 1010, 1011
Offset: 1

Views

Author

Jeremy Gardiner, Jul 20 2003

Keywords

Comments

All terms of A045953 appear in this sequence.
Subsequence of A008851; A045953 and A046851 are subsequences. [Reinhard Zumkeller, Jul 27 2011]
Intersection of A008851 and A089951. - Michel Marcus, Mar 19 2015

Examples

			a(12) = 115 appears in the sequence because 115*115 = 13225.
		

Crossrefs

Programs

  • BASIC
    left$(str$(n), 1) = left$(str$(n^2), 1) AND right$(str$(n), 1) = right$(str$(n^2), 1)
    
  • Haskell
    a086457 n = a086457_list !! (n-1)
    a086457_list = filter (\x -> a000030 x == a000030 (x^2) &&
                                 a010879 x == a010879 (x^2)) [0..]
    -- Reinhard Zumkeller, Jul 27 2011
  • Mathematica
    ldQ[n_]:=Module[{idn=IntegerDigits[n],idn2=IntegerDigits[n^2]}, First[ idn] == First[idn2]&&Last[idn]==Last[idn2]]; Select[Range[ 0,1100], ldQ]  (* Harvey P. Dale, Feb 06 2011 *)

Formula

A000030(a(n)) = A000030(a(n)^2) and A010879(a(n)) = A010879(a(n)^2).

Extensions

Offset corrected by Reinhard Zumkeller, Jul 27 2011

A045953 Numbers m such that m^2 can be obtained from m by inserting an internal block of (contiguous) digits.

Original entry on oeis.org

0, 1, 10, 11, 95, 96, 100, 101, 125, 976, 995, 996, 1000, 1001, 1025, 1376, 9625, 9976, 9995, 9996, 10000, 10001, 10025, 10376, 10625, 99376, 99625, 99976, 99995, 99996, 100000, 100001, 100025, 100376, 100625, 109376, 990625, 999376, 999625, 999976
Offset: 1

Views

Author

John "MazeMan" Knoderer (Webmaster(AT)Mazes.com)

Keywords

Comments

All terms of this sequence appear in A086457. - Jeremy Gardiner, Jul 20 2003
It seems that for any nonnegative integer k the number of k-digit terms is 2k. - Ivan N. Ianakiev, Aug 17 2021

Examples

			95^2 = 9025 (insert '02' inside '95').
		

Crossrefs

Programs

  • Haskell
    import Data.List (isPrefixOf, inits, isSuffixOf, tails)
    a045953 n = a045953_list !! (n-1)
    a045953_list = filter chi a008851_list where
       chi n = (x == y && xs `isSub'` ys) where
          x:xs = show $ div n 10
          y:ys = show $ div (n^2) 10
          isSub' us vs = any id $ zipWith (&&)
                                  (map (`isPrefixOf` vs) $ inits us)
                                  (map (`isSuffixOf` vs) $ tails us)
    -- Reinhard Zumkeller, Jul 27 2011

A277442 Least number k such that k^2 can be obtained from k by inserting internal (but not necessarily contiguous) digits in n different ways.

Original entry on oeis.org

0, 10, 101, 100, 10006, 950005, 1001, 9569005, 100105, 100500, 1000, 95370001, 1000201, 102100005, 9957800, 100006, 9500005, 1100005, 100100, 1010005, 10001, 10000096, 10005005, 1000105, 1001005, 999578000, 1002600005, 12500100, 100010505, 1050500005, 1000500
Offset: 0

Views

Author

Ivan N. Ianakiev, Oct 15 2016

Keywords

Comments

a(6) = 1001.

Examples

			a(2) = 101 as 101 is the least number that can be modified in two different ways in order to become its square; i.e., 101^2 equals 10201, which can be represented as 1(02)01 or 10(20)1.
a(5) = 950005 because 950005^2 = 902509500025 can be represented in 5 ways: 9(02)5(095)000(2)5, 9(02)50(95)0(0)0(2)5, 9(02)50(95)00(02)5, 9(02)50(950)00(2)5, 9(02509)5000(2)5.
		

Crossrefs

Extensions

Terms a(5), a(7) and beyond from Lars Blomberg, Nov 20 2016

A179856 Numbers n such that n^3 can be obtained from n by inserting internal (but not necessarily contiguous) digits.

Original entry on oeis.org

10, 11, 29, 34, 99, 100, 101, 106, 109, 110, 114, 119, 120, 124, 125, 274, 275, 276, 279, 281, 290, 296, 299, 314, 315, 316, 319, 320, 324, 325, 329, 330, 335, 336, 340, 966, 970, 975, 976, 979, 986, 990, 996, 999, 1000, 1001, 1004, 1005, 1006, 1010, 1020, 1021, 1024, 1025, 1034, 1049, 1051
Offset: 1

Views

Author

Jonathan Vos Post, Jan 28 2011

Keywords

Comments

This is to A046851 as cubes A000578 are to squares A000290. A subset of A086458 (but note that, i.e., 104^3 = 1124864 starts and ends with the same digits as 104, but lacks an internal "0"). If we require the inserted digits to fill contiguous places, another sequence results, which does not contain 106, for example.

Examples

			34^3 = 39304 (insert "930" into "34").
106^3 = 1191016 (insert "191" and "1" into "106").
		

Crossrefs

Programs

  • Maple
    A000030 := proc(n) if n= 0 then 0; else op(-1,convert(n,base,10)) ; end if; end proc:
    A010879 := proc(n) n mod 10 ; end proc:
    isA086458 := proc(n) A000030(n) = A000030(n^3) and A010879(n) = A010879(n^3) ; end proc:
    subsI := proc(c,L) for i from 1 to nops(L) do if op(i,L) = c then return i; end if; end do; return -1 ; end proc:
    isSubS := proc(Sub,Sup) if nops(Sub) = 1 then if subsI(op(1,Sub),Sup) > 0 then return true; else return false; end if; elif nops(Sub) = 0 then return true; else f := subsI(op(1,Sub),Sup) ; if f < 0 then return false; else procname( subsop(1=NULL,Sub), [op(f+1..nops(Sup),Sup)] ) ; end if; end if; end proc:
    isA179856 := proc(n) if isA086458(n) then dgsn := convert(n,base,10) ; dgsn := op(2..nops(dgsn)-1,dgsn) ; dgsn3 := convert(n^3,base,10) ; dgsn3 := op(2..nops(dgsn3)-1,dgsn3) ; isSubS([dgsn],[dgsn3]) ; else false; end if; end proc:
    for n from 10 to 1400 do if isA179856(n) then printf("%d,",n) ; end if; end do: # R. J. Mathar, Jan 30 2011

A277441 Least number k such that k^2 can be obtained from k by inserting n internal (but not necessarily contiguous) digits.

Original entry on oeis.org

0, 10, 95, 950, 9500, 89476, 894760, 8946105, 89448001, 894438005, 8944300005, 89442827780, 894427300005, 8944273000005, 89442720000005, 894427196000005, 8944271912400005, 89442719120000005, 894427191000000005, 8944271910000000005, 89442719100000000005, 894427191000000000005
Offset: 0

Views

Author

Ivan N. Ianakiev, Oct 15 2016

Keywords

Comments

A subsequence of A046851.

Examples

			a(2) = 95 as 95 is the least number that needs two internal digits inserted to become its square, i.e., 95 squared is 9(02)5.
		

Crossrefs

Extensions

More terms from Paolo P. Lava, Oct 20 2016
a(13)-a(21) from Giovanni Resta, Jul 06 2019
Showing 1-7 of 7 results.