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.

A068165 Smallest square formed from n by inserting zero or more decimal digits.

Original entry on oeis.org

1, 25, 36, 4, 25, 16, 576, 81, 9, 100, 121, 121, 1369, 144, 1156, 16, 1764, 1089, 169, 2025, 121, 225, 2304, 324, 25, 256, 2704, 289, 289, 2304, 361, 324, 3136, 324, 3025, 36, 3721, 3481, 1369, 400, 441, 4225, 4356, 144, 4225, 4096, 4761, 484, 49, 2500
Offset: 1

Views

Author

Amarnath Murthy, Feb 25 2002

Keywords

Comments

The digits may be added before, in the middle of, or after the digits of n.
If n is a square then a(n) = n. - Zak Seidov, Nov 13 2014

Examples

			Smallest square formed from 20 is 2025, by placing 25 on the right side. Smallest square formed from 33 is 3136, by inserting a 1 between 3's and placing a 6.
		

Crossrefs

A091873 gives square roots. Cf. A038690, A029944, A068164.

Programs

  • Maple
    A068165 := proc(n)
            local b,pdigs,plen,dmas,dmasdigs,i,j;
            for b from 1 do
                    pdigs := convert(b^2,base,10) ;
                    plen := nops(pdigs) ;
                    for dmas from 2^plen-1 to 0 by -1 do
                            dmasdigs := convert(dmas,base,2) ;
                            pdel := [] ;
                            for i from 1 to nops(dmasdigs) do
                                    if op(i,dmasdigs) = 1 then
                                            pdel := [op(pdel),op(i,pdigs)] ;
                                    end if;
                            end do:
                            if n = add(op(j,pdel)*10^(j-1),j=1..nops(pdel)) then
                                    return b^2;
                            end if;
                    end do:
            end do:
    end proc:
    seq(A068165(n),n=1..133) ; # R. J. Mathar, Nov 14 2014
  • Python
    from math import isqrt
    from itertools import count
    def dmo(n, t):
        if t < n: return False
        while n and t:
            if n%10 == t%10:
                n //= 10
            t //= 10
        return n == 0
    def a(n):
        return next(t for t in (i*i for i in count(isqrt(n))) if dmo(n, t))
    print([a(n) for n in range(1, 77)]) # Michael S. Branicky, Jan 21 2023

Extensions

Corrected and extended by Ray Chandler, Oct 11 2003

A029944 a(n)^2 contains n-th prime as a substring.

Original entry on oeis.org

5, 6, 5, 24, 34, 37, 42, 14, 48, 23, 56, 61, 21, 66, 69, 73, 77, 19, 26, 131, 86, 89, 94, 17, 176, 318, 321, 226, 331, 337, 113, 146, 371, 118, 339, 123, 397, 128, 409, 416, 134, 426, 438, 44, 346, 447, 46, 473, 472, 479, 483, 352, 79, 501, 507, 513, 519
Offset: 1

Views

Author

Keywords

Examples

			E.g. 34^2 = 1156 is first square that contains the string "11".
		

Crossrefs

Programs

  • Mathematica
    With[{e = 2}, Table[Function[p, k = 1; While[Length@ SequencePosition[ IntegerDigits[Set[c, k^e]], p] == 0, k++]; c]@ IntegerDigits@ Prime@ n, {n, 57}] ^(1/e)] (* Michael De Vlieger, May 04 2017, Version 10.1 *)

A346120 a(n) is the smallest nonnegative number k such that the decimal expansion of k! contains the string n.

Original entry on oeis.org

5, 0, 2, 8, 4, 7, 3, 6, 9, 11, 19, 22, 5, 15, 26, 25, 11, 14, 27, 29, 5, 19, 13, 18, 4, 23, 26, 13, 9, 14, 15, 32, 8, 24, 28, 17, 9, 18, 23, 11, 7, 27, 17, 15, 21, 19, 26, 12, 24, 23, 7, 19, 23, 32, 29, 17, 17, 18, 23, 25, 12, 26, 9, 26, 18, 30, 20, 15, 11, 27, 13
Offset: 0

Views

Author

Ilya Gutkovskiy, Jul 05 2021

Keywords

Examples

			a(3) = 8 since 3 occurs in 8! = 40320, but not in 0!, 1!, 2!, ..., 7!.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := (k = 0; While[! MatchQ[IntegerDigits[k!], {_, Sequence @@ IntegerDigits[n], _}], k++]; k); Table[a[n], {n, 0, 70}]
  • PARI
    a(n) = my(k=0, s=Str(n)); while (#strsplit(Str(k!), s) < 2, k++); k; \\ Michel Marcus, Jul 05 2021
    
  • Python
    def A346120(n):
        s, k, f = str(n), 0, 1
        while s not in str(f):
            k += 1
            f *= k
        return k # Chai Wah Wu, Jul 05 2021
Showing 1-3 of 3 results.