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.

A046834 Internal digits of n^2 include digits of n as subsequence.

Original entry on oeis.org

50, 60, 250, 500, 600, 760, 1050, 2050, 2500, 3050, 3628, 3710, 3760, 3792, 4050, 4410, 5000, 5010, 5050, 5060, 5250, 6000, 6010, 6050, 6250, 6760, 7050, 7560, 7600, 8050, 8250, 8260, 8882, 9050, 9460, 10050, 10500, 14650, 14651, 20050, 20500
Offset: 1

Views

Author

Keywords

Comments

If n is a member then so is 10*n. - Robert Israel, May 07 2020

Examples

			a(7) = 1050 is a term because 1050^2 = 1102500; remove the first and last to get internal digits 10250, and 1050 is a subsequence of 10250. - _Robert Israel_, May 07 2020
		

Crossrefs

Programs

  • Maple
    filter:= n -> StringTools:-IsSubSequence(sprintf("%d",n),sprintf("%d",n^2)[2..-2]):
    select(filter, [$10..30000]); # Robert Israel, May 07 2020
  • Python
    from itertools import count, islice
    def A046834_gen(startvalue=1): # generator of terms >= startvalue
        for k in count(max(startvalue,1)):
            c = iter(str(k**2)[1:-1])
            if all(map(lambda b:any(map(lambda a:a==b,c)),str(k))):
                yield k
    A046834_list = list(islice(A046834_gen(),20)) # Chai Wah Wu, Apr 03 2023

A326418 Nonnegative numbers k such that, in decimal representation, the subsequence of digits of k^2 occupying an odd position is equal to the digits of k.

Original entry on oeis.org

0, 1, 5, 6, 10, 11, 50, 60, 76, 100, 105, 110, 500, 501, 505, 506, 600, 605, 756, 760, 826, 1000, 1001, 1050, 1100, 5000, 5010, 5050, 5060, 5941, 6000, 6050, 7560, 7600, 8260, 10000, 10005, 10010, 10500, 10505, 11000, 12731
Offset: 1

Views

Author

Keywords

Comments

If k is in the sequence then so is 10*k. - David A. Corneth, Sep 29 2019
No term starts with the digit 2. - Chai Wah Wu, Apr 04 2023

Examples

			5^2 = 25, whose first digit is 5, hence 5 is a term of the sequence.
11^2 = 121, whose first and third digit are (1, 1), hence 11 is a term of the sequence.
756^2 = 571536, whose digits in odd positions - starting from the least significant one - are (7, 5, 6), hence 756 is a term of the sequence.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[0, 13000], Reverse@ #[[-Range[1, Length@ #, 2]]] &@ IntegerDigits[#^2] === IntegerDigits[#] &] (* Michael De Vlieger, Oct 06 2019 *)
  • PARI
    isok(n) = my(d=Vecrev(digits(n^2))); fromdigits(Vecrev(vector((#d+1)\2, k, d[2*k-1]))) == n; \\ Michel Marcus, Oct 01 2019
    
  • Python
    def ok(n): s = str(n*n); return n == int("".join(s[1-len(s)%2::2]))
    print(list(filter(ok, range(13000)))) # Michael S. Branicky, Sep 10 2021
Showing 1-2 of 2 results.