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.

User: Pieter Post

Pieter Post's wiki page.

Pieter Post has authored 42 sequences. Here are the ten most recent ones:

A333670 Numbers m such that m equals abs(d_1^k - d_2^k + d_3^k - d_4^k ...), where d_i is the decimal expansion of m and k is some power greater than 2.

Original entry on oeis.org

0, 1, 48, 240, 407, 5920, 5921, 2918379, 7444416, 18125436, 210897052, 6303187514, 8948360198, 10462450356, 11647261846, 18107015789, 27434621679, 31332052290, 4986706842391, 485927682264092, 1287253463537089, 126835771455251081, 559018292730428520, 559018292730428521
Offset: 1

Author

Pieter Post, Apr 01 2020

Keywords

Comments

For terms > 1, the exponents k are 2, 4, 3, 4, 4, 7, 8, 8, 11, 11, 21, 11, 11, 11, 11, 13, 15, 16, 22, 21, 21.

Examples

			48 = abs(4^2 - 8^2), 5920 = abs(5^4 - 9^4 + 2^4 - 0^4).
		

Crossrefs

Programs

  • Python
    def moda(n,a):
        kk,j = 0,1
        while n > 0:
            kk= kk-j*(n%10)**a
            n,j =int(n//10),-j
        return abs(kk)
    for i in range (0,10**7):
        for t in range(2,21):
            if i==moda(i,t):
                print (i)
                break

Extensions

a(19)-a(24) from Giovanni Resta, Apr 02 2020

A309755 Primes with record Euclidean distance from the origin. When starting rightwards in a grid, turn left after a prime number, if not walk straight on.

Original entry on oeis.org

2, 3, 11, 29, 59, 97, 149, 151, 191, 193, 211, 223, 239, 263, 281, 307, 311, 331, 337, 593, 613, 631, 641, 653, 659, 853, 857, 877, 881, 907, 911, 967, 971, 991, 997, 1801, 1811, 1847, 1861, 1901, 1907, 2251, 2267, 2281, 2287, 2309, 2311, 2657, 2671, 2677, 3163, 3167, 3187, 3191, 3299, 3319, 3343, 3691, 3697, 3719, 3727
Offset: 1

Author

Pieter Post, Aug 15 2019

Keywords

Comments

Cells can contain more than one number.
This sequence differs from A309701, where the Manhattan distance is taken.

Examples

			Grid of the first 34 steps. 0 (second cell in sixth row) represents (0,0).
---
xx  xx   xx   31   30    29
xx  xx   xx   32   xx    28
xx  xx   xx   33   xx    27
xx  xx   xx   34   xx    26
xx 5/17 4/16 3/15  14   13/25
x 0/6/18  1    2   xx   12/24
xx 7/19 8/20 9/21 10/22 11/23
---
2 (2,0) is two steps away from the origin, 3 (2,1) is at a distance of sqrt(5). Next record distance is 11 (4,-1), at distance sqrt(17). Next is 29 (4,5), at distance sqrt(41).
		

Crossrefs

Programs

  • Mathematica
    step[n_] := Switch[n, 0, {1, 0}, 1, {0, 1}, 2, {-1, 0}, 3, {0, -1}]; r = {0, 0}; q = 0; s={}; rm=0; Do[p = NextPrime[q]; r += step[Mod[n, 4]] * (p-q); r1 = Total @ (r^2); If[r1 > rm, rm = r1; AppendTo[s, p]]; q = p, {n, 0, 3000}]; s (* Amiram Eldar, Aug 15 2019 *)
  • PARI
    z=0; d=1; m=0; for (n=1, 3727, z+=d; if (isprime(n), d*=I; if (mRémy Sigrist, Aug 15 2019
  • Python
    def prime(z):
        isPrime=True
        for y in range(2,int(z**0.5)+1) :
            if z%y==0:
                isPrime=False
                break
        return isPrime
    m,n, g,h=[],[],[1,0,-1,0],[0,1,0,-1]
    z=10000
    for c in range (2,z):
        if prime(c)==True:
            m.append(c)
    ca,cb,cc=2,0,0
    for j in range(2,z):
        if j in m:
            cc=cc+1
            cd,ce=g[cc%4],h[cc%4]
        ca,cb=ca+cd,cb+ce
        n.append([j+1,ca,cb,((ca)**2+(cb)**2)**(0.5)])
        #print (j+1,ca,cb)
    v=2
    for j in n:
        if j[3]>v and j[0] in m:
            print (j)
            v=j[3]
    

A309701 Primes with record Manhattan distance from origin. When starting rightwards in a grid, turn left after a prime number. If not, walk straight on.

Original entry on oeis.org

2, 3, 11, 29, 59, 97, 151, 193, 211, 223, 239, 281, 307, 311, 331, 337, 479, 541, 593, 613, 631, 641, 659, 877, 881, 907, 911, 997, 1409, 1861, 1907, 2267, 2281, 2287, 2309, 2311, 2503, 2579, 2609, 2617, 2657, 2671, 2677, 3671, 3691, 3697, 3727, 3761, 3767, 3793, 3797, 4201, 4327, 4357, 4391, 4397, 4507, 4721, 4751, 4909
Offset: 1

Author

Pieter Post, Aug 13 2019

Keywords

Comments

This sequence differs from A309755 where the Euclidean distance is used.

Examples

			Grid of the first 34 steps. 0 represents (0,0).
xx  xx   xx   31   30    29
xx  xx   xx   32   xx    28
xx  xx   xx   33   xx    27
xx  xx   xx   34   xx    26
xx 5/17 4/16 3/15  14   13/25
x 0/6/18  1    2   xx   12/24
xx 7/19 8/20 9/21 10/22 11/23
2 (2,0) is 2 steps away from the origin, 3 (2,1) has a distance of 3. Next record distance is 11 (4,-1), distance 5. Next is 29 (4,5), distance 9.
		

Crossrefs

Programs

  • Mathematica
    step[n_] := Switch[n, 0, {1,0}, 1, {0,1}, 2, {-1,0}, 3, {0,-1}]; r = {0,0}; q = 0; s={}; rm=0; Do[p = NextPrime[q]; r += step[Mod[n, 4]] * (p-q); r1 = Total @ Abs @ r; If[r1 > rm, rm = r1; AppendTo[s, p]]; q = p, {n, 0, 3000}]; s (* Amiram Eldar, Aug 15 2019 *)
  • PARI
    upto(n) = {my(pos = [0, 0], rotateLeft = [0, -1; 1, 0], step = [1, 0], recordDistance = 0, q = 0, res = List(), i = 0); forprime(p = 2, n, pos += (p - q) * step; step *= rotateLeft; if(abs(pos[1]) + abs(pos[2]) > recordDistance, i++; recordDistance = abs(pos[1]) + abs(pos[2]); listput(res, p)); q = p); res} \\ David A. Corneth, Aug 15 2019
  • Python
    def prime(z):
        isPrime=True
        for y in range(2,int(z**0.5)+1) :
            if z%y==0:
                isPrime=False
                break
        return isPrime
    m,n,g,h=[],[],[1,0,-1,0],[0,1,0,-1]
    for c in range (2,10000):
        if prime(c)==True:
            m.append(c)
    ca,cb,cc=2,0,0
    for j in range(2,10000):
        if j in m:
            cc=cc+1
            cd,ce=g[cc%4],h[cc%4]
        ca,cb=ca+cd,cb+ce
        n.append([j+1,ca,cb,abs(ca)+abs(cb)])
    v=2
    for j in n:
        if j[3]>v and j[0] in m:
            print (j)
            v=j[3]
    

A319507 Smallest number of multiplicative-additive divisors persistence n.

Original entry on oeis.org

1, 2, 36, 3489, 24778899, 566677899999, 47777778999999999999
Offset: 0

Author

Pieter Post, Sep 21 2018

Keywords

Comments

To compute the "multiplicative-additive divisors persistence" of a number, we proceed as follows. Form the product of the digits of the number (A007954) divided by the sum of the digits (A007953). Repeat this process until you reach 0 or 1. If we reach a non-integer, we write 0. The "multiplicative-additive divisors persistence" is the number of steps to reach 0 or 1.
For instance: the multiplicative-additive divisors persistence of 874 is 1, because 874 -> 8 * 7 * 4 / (8 + 7 + 4) = 224/19. This is not an integer, so the process stops after one step.

Examples

			The multiplicative additive divisors persistence of 24778899 is 4: 24778899 -> (2032128/54=) 37632 -> (756/21=) 36 -> (18/9=) 2 -> (2/2=) 1.
		

Extensions

Offset set to 0. - R. J. Mathar, Jun 30 2020

A319274 Osiris or Digit re-assembly numbers: numbers that are equal to the sum of permutations of subsamples of their own digits.

Original entry on oeis.org

132, 264, 396, 8991, 10545, 35964, 255530, 1559844, 9299907, 47755078, 89599104, 167264994, 283797162, 473995260, 3929996070, 6379993620, 10009998999, 11111111110, 22222222220, 33333333330, 44444444440, 55555555550, 66666666660, 77777777770, 88888888880, 99999999990
Offset: 1

Author

Pieter Post, Sep 16 2018

Keywords

Comments

This sequence differs from A241754 because this sequence uses permutations only once.
Permutations are of the same length k, leading zeros are allowed.
The k's in the sequence are: 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 7, 10, 10, 10, 10, 10, 10, 10, 10, 10, 6, 7, 7, 8, 7, 9, 9.

Examples

			10545 = 014 + 015 + 041 + 045 + 051 + 054 + 055 + 104 + 105 + 140 + 145 + 150 + 154 + 155 + 401 + 405 + 410 + 415 + 450 + 451 + 455 + 501 + 504 + 505 + 510 + 514 + 515 + 540 + 541 + 545 + 550 + 551 + 554.
		

Crossrefs

Programs

  • Python
    import itertools
    def getData(a, b):
        dig = (itertools.permutations(str(a), b))
        for d in dig:
            yield d
    for w in range(2, 6):
        kk=int(w*'1')
        for i in range (kk, 10**(w+3), kk):
            m=[]
            get = getData(i, w)
            while True:
                try:
                    n = next(get)
                    ee=int("".join((n)))
                    if ee not in m:
                        m.append(ee)
                except StopIteration:
                    if sum (m)==i and len(m)>1:
                        m.sort()
                        print (sum(m), len(m), m, i)
                    break

Extensions

a(12)-a(26) from Giovanni Resta, Sep 16 2018

A317162 Sinuosity of the 26 letters of the alphabet, lettertype Calibri, multiplied by thousand and rounded.

Original entry on oeis.org

3515, 3570, 2621, 2820, 2425, 1722, 5734, 2226, 1000, 1237, 2159, 1342, 3349, 2696, 2987, 4570, 11862, 5688, 2355, 1551, 3971, 2848, 3353, 2358, 1603, 2060
Offset: 1

Author

Pieter Post, Jul 23 2018

Keywords

Comments

It appears that the average sinuosity of the letters in the alphabet is 3.14 (Pi), like the supposed average sinuosity of the rivers in the world.

Examples

			In Calibri the letter 'A' is in a rectangle 1 by 0.75, so l = 0.75. The letter A consists of two sloping lines which length is two times square root of (1^2 + 0.375^2) plus a line length 0.5, so L = 2,636. Therefore the sinuosity of A is 3.515 (2.636 divided by 0.75).
		

Formula

Sinuosity = L / l, where L is the length of the lines that make up the letter, l is the length of the straight line from the beginning to the end of the letter.

A274368 Numbers k such that if k is decreased by the sum of its digits and k is decreased by the product of its digits both differences are squares > 0.

Original entry on oeis.org

45, 48, 231, 121116, 159229, 11985489, 17514256, 51624256, 88172137, 228523729, 467597425, 11112111412, 4329279198937, 3716589421762641, 23228676113127556, 138417183479417732388
Offset: 1

Author

Pieter Post, Jun 19 2016

Keywords

Comments

It appears that if k is increased by the sum of its digits and k is increased by the product of its digits no two squares are found, except for the trivial k = 2 and k = 8.
The smallest k>8 such that k+A007953(k) and k+A007954(k) are both squares is k = 6469753431969. If a fourth such k exists, it must be larger than 1.6*10^19. - Giovanni Resta, Jun 19 2016

Examples

			45 - (4 + 5) = 36 and 45 - (4 * 5) = 25.
159229 - (1 + 5 + 9 + 2 + 2 + 9) = 157609 (= 397^2) and 159229 - (1*5*9*2*2*9) = 159201 (= 399^2).
From _David A. Corneth_, May 27 2021: (Start)
If the digits of a(n) = x are an anagram of 122599 then the product of digits is 1 * 2 * 2 * 5 * 9 * 9 = 1620 and the sum of digits is 1 + 2 + 2 + 5 + 9 + 9 = 28 as order of addition and multiplication does not matter. So x - 31 = m^2 and x - 1620 = k^2 for some positive integers k and m.
So m^2 - k^2 = (x - 28) - (x - 1620) = 1592 = (m - k)*(m + k). The divisors of 1592 are 1, 2, 4, 8, 199, 398, 796, 1592. Testing possible pairs m-k and m+k gives, among other pairs, (m - k, m + k) = (2, 796). Solving for k gives k = 397 so x = k^2 + 1620 = 397^2 + 1620 = 159229 giving an extra term. (End)
		

Crossrefs

Intersection of A066566 and A228187.

Programs

  • Mathematica
    lim = 10^6; s = Select[Range@ lim, IntegerQ@ # && # != 0 &@ Sqrt[# - Times @@ IntegerDigits@ #] &]; t = Select[Range@ lim, IntegerQ@ # && # != 0 &@ Sqrt[# - Total@ IntegerDigits@ #] &]; Intersection[s, t] (* Michael De Vlieger, Jun 19 2016 *)
  • PARI
    a007953(n) = sumdigits(n)
    a007954(n) = my(d=digits(n)); prod(i=1, #d, d[i])
    is(n) = n > 9 && issquare(n-a007953(n)) && issquare(n-a007954(n)) \\ Felix Fröhlich, Jun 19 2016
  • Python
    def pod(n):
        p = 1
        for x in str(n):
            p *= int(x)
        return p
    def sod(n):
        return sum(int(d) for d in str(n))
    def cube(z,p):
        iscube=False
        y=int(pow(z,1/p)+0.01)
        if y**p==z:
            iscube=True
        return iscube
    for c in range(1, 10**8):
        aa,ab=c-pod(c),c-sod(c)
        if cube(aa,2) and cube(ab,2) and aa>0:
           print(c,aa,ab)
    

Extensions

a(10)-a(15) from Giovanni Resta, Jun 19 2016
a(16) from David A. Corneth, May 27 2021

A266181 Numbers k such that k == d_1 (mod 2), k == d_2 (mod 3), k == d_3 (mod 4) etc., where d_1 d_2 d_3 ... is the decimal expansion of k.

Original entry on oeis.org

1, 11311, 1032327, 1210565, 11121217, 101033565, 111214177, 113411719, 121254557, 123254387, 10333633323, 12105652565, 11121314781937
Offset: 1

Author

Pieter Post, Dec 29 2015

Keywords

Comments

Subsequence of A131835, the numbers starting with 1. - Michel Marcus, Dec 30 2015
If it exists, a(14) >= 10^21. - Hiroaki Yamanouchi, Jan 12 2016
Definition assumes that d_i are residues, as otherwise 2,3,...,9 are also terms. - Chai Wah Wu, Jun 23 2020

Examples

			11311 == 1 (mod 2),
11311 == 1 (mod 3),
11311 == 3 (mod 4),
11311 == 1 (mod 5),
11311 == 1 (mod 6).
		

Crossrefs

Cf. A131835.

Programs

  • Mathematica
    Select[Range@ 2000000, First@ Union@ Function[k, MapIndexed[Mod[k, First@ #2 + 1] == #1 &, IntegerDigits@ k]]@ # &] (* Michael De Vlieger, Dec 30 2015 *)
  • PARI
    isok(n) = {my(d = digits(n)); for (i=1, #d, if (n % (i+1) != d[i], return (0));); return (1);} \\ Michel Marcus, Dec 30 2015
  • Python
    for b in range (3,11):
        for i in range (10**(b-2), 13*10**(b-3)):
            si,k,kk=str(i),0,i
            for j in range(1,b):
                if int(si[len(str(i))-j])==kk%(b+1-j):
                    k=k+1
            if k==len(str(i)):
                print (i)
    
  • Python
    def ok(n): return all(n%i == di for i, di in enumerate(map(int, str(n)), 2)) # Michael S. Branicky, Jan 21 2025
    

Extensions

a(6)-a(12) from Michel Marcus, Dec 30 2015
a(13) from Hiroaki Yamanouchi, Jan 12 2016

A263535 a(1) = 1; thereafter a(n) = a(n-1) + d_1^1 + d_2^2 + d_3^3 + ..., where d_1 d_2 d_3 ... is the decimal expansion of a(n-1).

Original entry on oeis.org

1, 2, 4, 8, 16, 53, 67, 122, 135, 270, 321, 329, 1065, 1907, 4390, 5132, 5181, 5700, 5754, 6189, 13269, 73632, 73977, 93930, 94758, 128519, 661103, 661876, 729478, 1009425, 1095200, 1096587, 2187425, 2269554, 2311471, 2430158, 4542981, 4864284, 5143384, 5422306
Offset: 1

Author

Pieter Post, Oct 20 2015

Keywords

Comments

This additive sequence will tend to be geometric.

Examples

			a(5)=16, so a(6) is 16 + 1^1 + 6^2 = 53.
		

Crossrefs

Programs

  • Mathematica
    NestList[#+Total[IntegerDigits[#]^Range[IntegerLength[#]]]&,1,40] (* Harvey P. Dale, Jan 19 2021 *)
  • PARI
    lista(nn) = {print1(a=1, ", "); for (n=2, nn, d = digits(a); na = a + sum(i=1, #d, d[i]^i); print1(na, ", "); a = na;);} \\ Michel Marcus, Nov 20 2015
  • Python
    def moda(n):
        return sum(int(d)**(i + 1) for i, d in enumerate(str(n)))
    b = 1
    resu = [1]
    for a in range(1, 100):
        b += moda(b)
        resu.append(b)
    resu
    
  • Sage
    A=[1]
    for i in [1..2000]:
        A.append(A[i-1]+sum(A[i-1].digits()[len(A[i-1].digits())-1-j]^(j+1) for j in [0..len(A[i-1].digits())-1]))
    A # Tom Edgar, Oct 20 2015
    

A260305 We represent square arrays of single-digit entries by the single number formed by reading them row-by-row, top-to-bottom. Sequence gives list of k X k square grids formed from single-digit numbers having property that reading across each row and each column gives a square number.

Original entry on oeis.org

1, 4, 9, 1664, 3664, 6449, 8116, 121256169, 121289196, 144400400, 144484441, 169676961, 361676169, 441400100, 441484144, 529256961, 729256961, 841400100, 841484144, 961676169, 1296202592166561, 1369384464009409
Offset: 1

Author

Pieter Post, Nov 10 2015

Keywords

Comments

Suppose for example a term has 9 digits, say abcdefghi. This means that the grid is
abc
def
ghi
and that the decimal concatenations abc, def, ghi, adg, beh, cfi are all squares. E.g., for 121256169 we see that 121, 256, 169, 121, 256 and 169 are squares.
There are 3 grids of size 1 X 1.
There are 4 grids of size 2 X 2.
There are 13 grids of size 3 X 3.
There are 14 grids of size 4 X 4.
There are 76 grids of size 5 X 5.
There are 108 grids of size 6 X 6.
There are 459 grids of size 7 X 7.
There are 844 grids of size 8 X 8.
No leading zeros are allowed in the rows and columns.

Examples

			169676961 is in the sequence, so the 3 X 3 grid is:
(1 6 9)
(6 7 6)
(9 6 1)
146414494469696449441461 is in the sequence; this is a 25-digit term, and the 5 X 5 grid is:
(1 4 6 4 1)
(4 4 9 4 4)
(6 9 6 9 6)
(4 4 9 4 4)
(1 4 6 4 1)
		

Crossrefs

Cf. A105074.

Extensions

Corrected and extended by Luca Petrone, Jan 08 2017