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

A176905 Primes p such that p^p contains the string 'p' as a substring.

Original entry on oeis.org

5, 11, 17, 19, 31, 37, 41, 43, 53, 59, 61, 71, 73, 79, 83, 97, 101, 103, 127, 131, 151, 173, 191, 193, 227, 233, 251, 263, 269, 271, 293, 313, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 401, 419, 421, 431, 433, 439, 443, 461, 467, 487, 491, 499, 503, 521
Offset: 1

Views

Author

Harvey P. Dale & Vladimir Joseph Stephan Orlovsky, Apr 28 2010, May 01 2010

Keywords

Comments

17^17=827240261886336764"17"7, 19^19="19"784"19"655660313589123979,..

Crossrefs

Programs

  • Mathematica
    okQ[n_]:=Module[{idn=IntegerDigits[n], len, idp=IntegerDigits[n^n]}, len=Length[idn];Length[Flatten[Position[Partition[idp, len, 1], idn]]]>=1]; Select[Prime[Range[250]], okQ]

A229629 Numbers k such that k is in the middle of decimal expansion of k^k.

Original entry on oeis.org

1, 6, 888, 1808, 2138, 65246, 268105
Offset: 1

Views

Author

Farideh Firoozbakht, Oct 04 2013

Keywords

Comments

a(6) is greater than 50000.
a(8) > 600000. - Giovanni Resta, Oct 08 2013

Examples

			6 is in the sequence because 6^6 = 46656, which includes a 6 in the middle.
11 is not in the sequence, because even though the substring 11 appears twice in 11^11 = 285311670611, neither occurrence is precisely in the middle.
		

Crossrefs

Programs

  • Mathematica
    Do[a = IntegerDigits[n^n]; b = Length[a]; c = IntegerLength[n]; If[EvenQ[b - c] && FromDigits[Take[a, {(b - c)/2 + 1, (b + c)/2}]] == n, Print[n]], {n, 50000}]
  • PARI
    is(n)=my(d=digits(n),D=digits(n^n)); if((#d+#D)%2, return(0)); for(i=1,#d, if(d[i]!=D[#D/2-#d/2+i], return(0))); 1 \\ Charles R Greathouse IV, Jul 30 2016
    
  • Python
    from itertools import islice
    def A229629(): # generator of terms
        n = 1
        while True:
            s, sn = str(n**n), str(n)
            l, ln = len(s), len(sn)
            if (ln-l) % 2 == 0 and s[l//2-ln//2:l//2+(ln+1)//2] == sn: yield n
            n += 1
    A229629_list = list(islice(A229629(),5)) # Chai Wah Wu, Nov 21 2021

Extensions

a(6)-a(7) from Giovanni Resta, Oct 08 2013

A236314 Number of non-overlapping occurrences of n in the decimal representation of n^n.

Original entry on oeis.org

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

Views

Author

Christian Perfect, Jan 22 2014

Keywords

Examples

			6^6 is 46656 with 3 6's, hence a(6) = 3.
		

Crossrefs

A049329 lists n where a(n) is nonzero.
The same sequence but allowing for overlapping occurrences is at A236322.

Programs

  • Mathematica
    a[n_] := Length@ StringPosition[ToString[n^n], ToString[n], Overlaps -> False]; (* Giovanni Resta, Jan 22 2014 *)
  • Python
    from itertools import count
    a=(str(n**n).count(str(n)) for n in count(1))

A236322 Number of (potentially overlapping) occurrences of n in the decimal representation of n^n.

Original entry on oeis.org

1, 0, 0, 0, 1, 3, 0, 0, 1, 1, 2, 0, 0, 0, 0, 2, 1, 0, 2, 0, 2, 0, 0, 1, 2, 0, 0, 1, 0, 0, 2, 2, 2, 0, 3, 1, 1, 0, 1, 0, 1, 1, 1, 0, 3, 1, 0, 1, 1, 1, 1, 2, 2, 1, 0, 1, 1, 0, 1, 3, 2, 0, 1, 1, 0, 2, 0, 0, 0, 0, 1, 0, 1, 1, 2, 5, 2, 1, 2, 0, 3, 3, 2, 1, 0, 1, 0, 0, 0, 0, 5, 1, 3, 4, 2, 2, 1, 1, 10
Offset: 1

Views

Author

Christian Perfect, Jan 22 2014

Keywords

Comments

Differs from A236314 at n=99.

Crossrefs

A049329 lists n where a(n) is nonzero.
Non-overlapping occurrences are counted by A236314.

Programs

  • Mathematica
    a[n_] := Length[StringPosition @@ ToString /@ {n^n, n}]; Array[a, 99] (* Giovanni Resta, Jan 22 2014 *)
  • PARI
    a(n) = my(m=Mod(n,10^#Str(n)));(m==n=n^n)+sum(i=0,1+log(n)/log(10),m==n\=10) \\ - M. F. Hasler, Jan 23 2014
  • Python
    from itertools import count
    def occurrences(string, sub):
        count = start = 0
        while True:
            start = string.find(sub, start) + 1
            if start > 0:
                count+=1
            else:
                return count
    def a(n):
        return occurrences(str(n**n), str(n))
    

A050763 Numbers k such that the decimal expansion of k^k contains no pair of consecutive equal digits (probably finite).

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 7, 9, 15, 18
Offset: 1

Views

Author

Patrick De Geest, Sep 15 1999

Keywords

Crossrefs

Extensions

Changed offset to 1. - N. J. A. Sloane, Aug 24 2019

A050764 Numbers of form k^k (for values of k see A050763) containing no pair of consecutive equal digits (probably finite).

Original entry on oeis.org

1, 4, 27, 256, 3125, 823543, 387420489, 437893890380859375, 39346408075296537575424
Offset: 1

Views

Author

Patrick De Geest, Sep 15 1999

Keywords

Crossrefs

Programs

  • Mathematica
    Select[Table[k^k,{k,20}],FreeQ[Differences[IntegerDigits[#]],0]&] (* Harvey P. Dale, Aug 23 2019 *)

Extensions

Since this is a list, it has offset 1 and does not contain any repeated terms. - N. J. A. Sloane, Aug 24 2019

A169754 Numbers of the form k^k which contain k as a substring in base 10.

Original entry on oeis.org

1, 3125, 46656, 387420489, 10000000000, 285311670611, 18446744073709551616, 827240261886336764177, 1978419655660313589123979, 5842587018385982521381124421
Offset: 1

Views

Author

N. J. A. Sloane, May 03 2010

Keywords

Comments

k^k for k in A049329.

Crossrefs

A343594 Numbers k that, when written in all bases from base 2 to base 10, are a substring of k^k when written in the same base.

Original entry on oeis.org

1, 5, 17, 25, 31, 41, 63, 92, 151, 170, 202, 221, 263, 266, 278, 322, 327, 347, 364, 401, 404, 412, 421, 423, 437, 467, 470, 482, 490, 498, 501, 515, 519, 543, 558, 578, 590, 612, 623, 636, 646, 647, 671, 683, 685, 705, 707, 717, 718, 726, 764, 785, 795, 859, 867, 872, 875, 881, 890, 892, 897
Offset: 1

Views

Author

Scott R. Shannon, Apr 21 2021

Keywords

Examples

			5 is a term. See below table:
.
   base  |  5 in base  |  5^5 in base
---------+-------------+-------------
    10          5                3125
     9          5                4252
     8          5                6065
     7          5               12053
     6          5               22245
     5         10              100000
     4         11              300311
     3         12            11021202
     2        101        110000110101
.
5^5 in all bases contains 5 in that base as a substring.
		

Crossrefs

Programs

  • PARI
    str(v) = my(s=""); for (k=1, #v, s = concat(s, Str(v[k]))); s;
    isok(k) = {for (b=2, 10, my(kb = digits(k, b), kkb = digits(k^k, b)); if (#strsplit(str(kkb), str(kb)) <=1 , return (0));); return (1);} \\ Michel Marcus, Apr 26 2021
  • Python
    from sympy.ntheory import digits
    def nstr(n, b): return "".join(map(str, digits(n, b=b)[1:]))
    def ok(k): return all(nstr(k, b) in nstr(k**k, b) for b in range(10, 1, -1))
    print(list(filter(ok, range(900)))) # Michael S. Branicky, Apr 25 2021
    
Showing 1-8 of 8 results.