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: Reiner Moewald

Reiner Moewald's wiki page.

Reiner Moewald has authored 38 sequences. Here are the ten most recent ones:

A367378 2*k-digit squares with the left half being a reversed k-digit square and the right half being a k-digit square.

Original entry on oeis.org

49, 1849, 144400, 148225, 522729, 16564900, 40322500, 46717225, 98446084, 98863249, 1429293636, 1697440000, 4013222500, 4228250625, 4247128900, 4684991809, 5205622500, 5227290000, 6161465025, 6557274529, 104409765625, 121975562500, 123151864900, 127413302500, 140301186624
Offset: 1

Author

Reiner Moewald, Nov 15 2023

Keywords

Examples

			522729 is in the sequence since reversed the left half is the square 15^2 and the right half is the square 27^2.
A 6-digit term might start with 522 as 522 is the reversal of a three-digit square (namely 225 = 15^2). If a 6-digit term starts with 522 then it is between (inclusive) 522100 and 522999. The only such square is 522729. As 729 (= 522729 - 522000) is a square we have 522729 is in the sequence. - _David A. Corneth_, Nov 21 2023
		

Crossrefs

Programs

  • PARI
    \\ See PARI link
  • Python
    from math import isqrt
    from itertools import count, islice
    def agen(): # generator of terms
        for k in count(1):
            lb, ub, sk = isqrt(10**(k-1)-1)+1, isqrt(10**k-1), set()
            for i in range(lb, ub+1):
                if i%10 == 0: continue
                left = int(str(i*i)[::-1]) * 10**k
                # loop below based on idea by David A. Corneth in Example
                lbt, ubt = isqrt(left-1)+1, isqrt(left + 10**k - 1)
                for t in range(lbt, ubt+1):
                    tt = t*t
                    right = tt - left
                    sr = str(right)
                    if len(sr) == k and isqrt(right)**2 == right:
                        sk.add(tt)
            yield from sorted(sk)
    print(list(islice(agen(), 20))) # Michael S. Branicky, Nov 21 2023
    

Extensions

More terms from David A. Corneth, Nov 20 2023

A356334 a(n) is the number of nonnegative integer solutions (x; y) with x <= y of x^(n+1) + y^(n+1) = (x+y)^n.

Original entry on oeis.org

1, 3, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3
Offset: 0

Author

Reiner Moewald, Aug 04 2022

Keywords

Comments

Conjecture: a(n) = 3 except for n = 0 or n = 2. - Chai Wah Wu, Sep 21 2022

Examples

			For n=2, the 4 solutions are (0; 0), (0; 1), (1; 2) and (2; 2). The pairs (0; 0), (0; 1) and (2^(n-1); 2^(n-1)) exist for all n > 0.
		

Programs

  • Python
    def A356334(n): return sum(1 for x in range((1<Chai Wah Wu, Sep 19 2022

Extensions

a(11)-a(14) from Hugo Pfoertner, Sep 18 2022
a(15)-a(20) from Chai Wah Wu, Sep 21 2022

A347189 Positive integers that can be expressed as the sum of powers of their digits (from right to left) with consecutive natural exponents.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 24, 332, 1676, 121374, 4975929, 134116265, 1086588775, 3492159897, 8652650287, 8652650482
Offset: 1

Author

Reiner Moewald, Aug 21 2021

Keywords

Comments

Any number > 9 consisting of just one digit (A014181) can't be in the list. (Provable using the Carmichael function.)

Examples

			24 = 4^2 + 2^3 is a term.
332 = 2^3 + 3^4 + 3^5 is another term.
		

Crossrefs

Programs

  • Python
    liste = []
    for ex in range(0, 20):
        for t in range(1, 10000):
            n = t
            pot = ex
            ergebnis = 0
            while n > 0:
                pot = pot + 1
                rest = n % 10
                n = (n - rest) // 10
                zw = 1
                for i in range(pot):
                    zw = zw * rest
                ergebnis = ergebnis + zw
            if (int(ergebnis) == t) and (t not in liste):
                liste.append(t)
    liste.sort()
    print(liste)
    
  • Python
    def powsum(digits, startexp):
        return sum(digits[i]**(startexp+i) for i in range(len(digits)))
    def ok(n):
        if n < 10: return True
        s = str(n)
        if set(s) <= {'0', '1'}: return False
        digits, startexp = list(map(int, s))[::-1], 1
        while powsum(digits, startexp) < n: startexp += 1
        return n == powsum(digits, startexp)
    print(list(filter(ok, range(2*10**5)))) # Michael S. Branicky, Aug 29 2021

Extensions

a(15)-a(19) from Michael S. Branicky, Aug 31 2021

A344633 Lengths k of k-digit integers of the form 1, 12, 123, 1234, ... (A057137) which are divisible by k.

Original entry on oeis.org

1, 2, 3, 5, 6, 9, 10, 12, 14, 15, 16, 18, 30, 90, 96, 110, 197, 210, 270, 330, 390, 410, 630, 810, 930, 959, 990, 1110, 1170, 1210, 1230, 1470, 1710, 1890, 1956, 2310, 2430, 2530, 2538, 2710, 2730, 2790, 2802, 2922, 2970, 3330, 3510, 3519, 3630, 3690, 4115, 4245
Offset: 1

Author

Reiner Moewald, May 26 2021

Keywords

Comments

It is easy to prove that 10*3^k, k >= 0 is always a solution.

Examples

			3 is a term since 123 is divisible by 3 (123 = 3*41).
		

Crossrefs

Cf. A057137.

Programs

  • Maple
    for n from 1 to 5000 do
        if modp(A057137(n),n) = 0 then
            printf("%d,",n) ;
        end if;
    end do: # R. J. Mathar, Aug 16 2021
  • PARI
    f(n) = 137174210*10^n\1111111111; \\ A057137
    isok(k) = (f(k) % k) == 0; \\ Michel Marcus, Aug 16 2021
  • Python
    a ="1234567890"
    for k in range(10):
        a = a + a
    sol = ""
    for n in range(1, len(a)):
        if int(a[0:n]) % n == 0:
            sol = sol + str(n) + ", "
    print(sol)
    

Formula

{n: n|A057137(n)}. - R. J. Mathar, Aug 16 2021

A334929 Positive integers k such that there exists a positive integer m consisting of k identical digits and such that m is a multiple of k.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 12, 15, 18, 21, 22, 24, 27, 36, 42, 44, 45, 54, 63, 66, 72, 78, 81, 84, 88, 108, 111, 126, 132, 135, 156, 162, 168, 189, 198, 205, 216, 222, 234, 242, 243, 252, 264, 294, 312, 324, 333, 342, 378, 396, 404, 405, 444, 462, 465, 468, 484, 486
Offset: 1

Author

Reiner Moewald, May 16 2020

Keywords

Comments

For k=3^t, t>=1 you can always find numbers m.

Examples

			12 is a term since 444444444444 = 12*37037037037.
		

Crossrefs

Cf. A014950.

Programs

  • Mathematica
    ok[n_] := AnyTrue[(10^n - 1)/9 Range@9, Mod[#, n] == 0 &]; Select[ Range[486], ok] (* Giovanni Resta, May 24 2020 *)
  • Python
    t = "1"
    list = [1]
    for i in range(1, 1000):
        t = "1" + t
        m = int(t)
        weiter = 0
        for k in range(1, 10):
            if k * m % (i + 1) == 0:
                weiter = 1
        if weiter == 1:
            list.append(i + 1)
    print(list)

A333312 Positive integers m >= 2 such that there is a value of v such that the sequence {v, ..., v + m - 1} of m nonnegative integers can be partitioned into two subsets of consecutive integers with the same sum.

Original entry on oeis.org

9, 15, 20, 21, 24, 25, 27, 28, 33, 35, 36, 39, 40, 44, 45, 48, 49, 51, 52, 55, 56, 57, 60, 63, 65, 68, 69, 72, 75, 76, 77, 80, 81, 84, 85, 87, 88, 91, 92, 93, 95, 96, 99, 100, 104, 105, 108, 111, 112, 115, 116, 117, 119, 120, 121, 123, 124, 125, 129, 132, 133
Offset: 1

Author

Reiner Moewald, Mar 14 2020

Keywords

Comments

There are no subsets for m = 4 * k + 6 and just one subset for prime numbers m.

Examples

			m = 9, v=16: 16 + 17 + 18 + 19 + 20 = 21 + 22 + 23 + 24.
m = 9, v=2: 2 + 3 + 4 + 5 + 6 + 7 = 8 + 9 + 10 = 27.
		

References

  • Wilfried Haag, Die Wurzel. Problem 2020 - 14. (March/April 2020: www.wurzel.org)

Programs

  • Python
    for m in range(3, 1000):
        anz = 0
        for i in range(m // 2 + 1, m):
            l = (2 * i * i - 2 * i - m * (m - 1)) / (2 * (m - 2 * i))
            if l - int(l) == 0 and l >= 0:
                anz = anz + 1
        if anz > 1:
            print(m)

Formula

For m = 6 * k + 3, you can always find two subsets of {v, ...,v+m-1} of length 3 * k + 2 with v = (3 * k + 1)^2 and length 3 * k + 3 with v = 3*k^2-1 elements.

A328343 Numbers k such that it is possible to find k consecutive squares whose sum is equal to the sum of two consecutive squares.

Original entry on oeis.org

1, 2, 3, 10, 17, 25, 26, 34, 41, 50, 51, 65, 73, 82, 89, 97, 106, 113, 122, 123, 145, 146, 169, 170, 178, 185, 194, 218, 219, 241, 250, 257, 267, 274, 281, 291, 298, 305, 314, 338, 339, 353, 362, 370, 377, 386, 394, 401, 409, 410, 411, 433, 449, 457, 505, 530, 545
Offset: 1

Author

Reiner Moewald, Oct 13 2019

Keywords

Comments

The program generates solutions to the problem, but not necessarily all solutions. To exclude the existence of further solution you have to apply coset arithmetics (modulo operations).

Examples

			k = 1: 3^2 + 4^2 = 5^2.
k = 2: 3^2 + 4^2 = 3^2 + 4^2.
k = 3: 13^2 + 14^2 = 10^2 + 11^2 + 12^2.
k = 10: 26^2 + 27^2 = 7^2 + ... + 16^2.
k = 17: 40^2 + 41^2 = 5^2 + ... + 21^2.
k = 25: 78^2 + 79^2 = 9^2 + ... + 33^2.
k = 26: 205^2 + 206^2 = 44^2 + ... + 49^2.
k = 34: 856^2 + 857^2 = 191^2 + ... + 224^2.
k = 41: 3029^2 + 3030^2 = 649^2 + ... + 689^2.
k = 50: 146^2 + 147^2 = 1^2 + ... + 50^2.
k = 51: 210^2 + 211^2 = 14^2 + ... + 64^2.
k = 65: 236^2 + 237^2 = 5^2 + ... + 69^2.
k = 73: 278^2 + 279^2 = 5^2 + ... + 76^2.
k = 82: 1070^2 + 1071^2 = 125^2 + ... + 206^2.
k = 89: 147445^2 + 147446^2 = 22059^2 + ... + 22147^2.
k = 97: 544^2 + 545^2 = 25^2 + ... + 121^2.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[60], {} != FindInstance[ Sum[t^2, {t, x, x+#-1}] == y^2 + (y + 1)^2, {x, y}, Integers] &] (* Giovanni Resta, Oct 23 2019 *)
  • Python
    import math
    for n in range(1, 100):
       for b in range(1, 10000000):
          d = (6*b*b*(n+1)+6*b*n*(n+1)+2*n*n*n+3*n*n+n)
          w = int((math.sqrt(d/6)))
          a = w
          if 6*a*a-6*b*b*(n+1)-6*b*n*(n+1)-2*n*n*n-3*n*n-n == 0:
             print(a,b,n+1)
          a = w+1
          if 6*a*a-6*b*b*(n+1)-6*b*n*(n+1)-2*n*n*n-3*n*n-n == 0:
             print(a,b,n+1)
          a = w-1
          if 6*a*a-6*b*b*(n+1)-6*b*n*(n+1)-2*n*n*n-3*n*n-n == 0:
             print(a,b,n+1)

Extensions

a(17)-a(38) from Jon E. Schoenfield, Oct 22 2019
a(39)-a(57) from Jon E. Schoenfield and Giovanni Resta, Oct 23 2019

A309417 Number of steps needed to reduce 10^n to zero by subtracting its digital sum.

Original entry on oeis.org

2, 11, 81, 611, 4798, 39320, 333583, 2897573, 25632474, 230231687, 2091437006, 19145032382, 176258021378, 1630867803755, 15161044498785, 141573907590908, 1327916557473475, 12513166293358138, 118472791400037286, 1126683083504083356, 10754171449735292485
Offset: 1

Author

Reiner Moewald, Jul 30 2019

Keywords

Comments

Conjecture: lim_{n->infinity} a(n+1)/a(n) = 10.

Examples

			a(100)=11 since 100->99->81->72->63->54->45->36->27->18->9->0.
		

Crossrefs

Cf. A066568 (n - sum of digits of n).

Programs

  • Mathematica
    f[n_] := Length[NestWhileList[# - Total[IntegerDigits[#]]&, n, # > 0 &]]-1; f /@ (10^Range[8]) (* Amiram Eldar, Aug 08 2019 *)
  • PARI
    a(n)={my(s=10^n, k=0); while(s, k++; s-=sumdigits(s)); k} \\ Andrew Howroyd, Sep 09 2019
  • Python
    import math
    def digitsum(n):
       ds = 0
       while n > 0:
          ds += n % 10
          n = n // 10
       return ds
    def steps(n):
       count = 0
       while n > 0:
          n = n - digitsum(n)
          count += 1
       return count
    n = 1
    for i in range(1,10):
       n = 10 * n
       print(steps(n))
    

Extensions

a(13)-a(15) from Giovanni Resta, Sep 10 2019
a(16) and on from Dominic McCarty, Feb 12 2025

A323612 Numbers k such that k^2 starts with at least the same number >= 2 of equal digits as does k itself.

Original entry on oeis.org

88, 332, 334, 335, 336, 337, 338, 339, 664, 665, 667, 668, 669, 880, 881, 882, 883, 995, 996, 997, 998, 3317, 3318, 3319, 3320, 3321, 3322, 3323, 3324, 3325, 3326, 3327, 3328, 3329, 3332, 3334, 3335, 3336, 3337, 3338, 3339, 3340, 3341, 3342, 3343, 3344, 3345, 3346, 3347
Offset: 1

Author

Reiner Moewald, Jan 20 2019

Keywords

Examples

			332^2 = 110224, i.e., both the integer and its square start with two equal digits.
Also 334^2 = 111556, so 334 is a term.
		

Programs

  • PARI
    nbi(d) = my(nb=1); for(k=2, #d, if (d[k] == d[1], nb++, break)); nb;
    isok(n) = my(nb = nbi(digits(n))); (nb > 1) && (nbi(digits(n^2)) >= nb); \\ Michel Marcus, Apr 24 2019
  • Python
    def zahl(z):
       a = str(z)
       r = 0
       while r < len(a) and a[0] == a[r]:
          r = r + 1
       b = str(z*z)
       s = 0
       while r < len(b) and b[0] == b[s]:
          s = s + 1
       if r >= 2:
          return(s-r)
       else:
          return(-1)
    anz = 0
    for i in range(1000000):
       if zahl(i) >= 0:
          anz = anz +1
          print(anz, i)
    

A308391 Number of ordered pairs of n-digit positive integers the product of which is a 2n-digit integer.

Original entry on oeis.org

58, 6610, 668843, 66965113, 6697324753, 669740590290, 66974140069358, 6697414817000983, 669741489800555031, 66974149061059480123
Offset: 1

Author

Reiner Moewald, May 23 2019

Keywords

Examples

			a(1)=58 since we get the following pairs: (2, 5), ..., (2, 9), (3, 4), ..., (3, 9), (4, 3), ..., (4, 9), (5, 2), ..., (5, 9), (6, 2), ..., (6, 9), (7, 2), ..., (7, 9), (8, 2), ..., (8, 9), (9, 2), ..., (9, 9).
		

Crossrefs

Cf. A174425.

Programs

  • PARI
    a(n) = 9*10^(2*n-1) - 10^n - sum(k=10^(n-1)+1, 10^n-1, ceil(10^(2*n-1)/k)); \\ Michel Marcus, Jun 25 2019
  • Python
    import math
    ende = 1
    for i in range(1,10):
       anz = 0
       for a in range(ende, 10*ende):
          z = math.ceil((ende*ende*10)/a)
          if z < ende*10:
             anz = anz + ende*10 - z
       ende = ende*10
       print(i, anz)
    

Formula

a(n) = 9*10^(2n-1) - 10^n - Sum_{k=10^(n-1)+1..10^n-1} ceiling(10^(2n-1)/k).
a(n) ~ (9-log(10))*10^(2n-1).