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: Simon R Blow

Simon R Blow's wiki page.

Simon R Blow has authored 7 sequences.

A384468 a(0) = 1; for n >= 1, a(n) = a(n-1)/2 if a(n-1) is even, otherwise a(n) = 2*a(n-1) + n.

Original entry on oeis.org

1, 3, 8, 4, 2, 1, 8, 4, 2, 1, 12, 6, 3, 19, 52, 26, 13, 43, 104, 52, 26, 13, 48, 24, 12, 6, 3, 33, 94, 47, 124, 62, 31, 95, 224, 112, 56, 28, 14, 7, 54, 27, 96, 48, 24, 12, 6, 3, 54, 27, 104, 52, 26, 13, 80, 40, 20, 10, 5, 69, 198, 99, 260, 130, 65, 195, 456, 228, 114, 57, 184
Offset: 0

Author

Simon R Blow, May 30 2025

Keywords

Comments

The sequence behaves similarly to the Collatz sequence but introduces a linearly increasing term n when updating odd values.
a(n) = 1 for n = 0, 5, 9, 60843, 19628571, and 772944372 and no other values up to 10^14. - David Radcliffe, Jun 18 2025

Examples

			a(2) = 2*3 + 2 = 8 (since a(1) is odd).
a(3) = 8/2 = 4 (since a(2) is even).
		

Crossrefs

Programs

  • Mathematica
    a[0] = 1; a[n_] := a[n] = If[EvenQ[a[n-1]], a[n-1]/2, 2*a[n-1] + n]; Array[a, 100, 0] (* Amiram Eldar, May 30 2025 *)
  • Python
    def generate_sequence(n_terms):
        seq = [1]  # a(0) = 1
        for n in range(1, n_terms):
            prev = seq[-1]
            if prev % 2 == 0:
                seq.append(prev // 2)
            else:
                seq.append(2 * prev + n)
        return seq
    seq = generate_sequence(1000)
    print(seq)

Formula

a(0) = 1.
For n >= 1:
a(n) = a(n-1)/2 if a(n-1) is even;
a(n) = 2*a(n-1) + n if a(n-1) is odd.

A378625 The first subsequence starting at the first digit after the decimal point in the decimal expansion of Pi that is divisible by n.

Original entry on oeis.org

1, 14, 141, 141592, 1415, 141592653589793238, 14, 141592, 141592653, 14159265358979323846264338327950, 141592, 1415926535897932384626433832795028, 14159265358979, 14, 14159265, 1415926535897932384, 141592653589793, 141592653589793238, 141592653589793238462
Offset: 1

Author

Simon R Blow, Dec 02 2024

Keywords

Comments

For every positive integer n there exists a contiguous subsequence of the decimal expansion of Pi that is divisible by n (conjectured).

Examples

			a(3) = 141 is the first integer in the sequence that is divisible by 3.
a(6) = 141592653589793238 is the first integer in the sequence that is divisibe by 6.
		

Crossrefs

Cf. A014777 (if start can move).

Programs

  • Python
    from mpmath import mp
    mp.dps = 1000000
    pi_digits = str(mp.pi)[2:]
    def first_divisible(n):
        current_number = 0
        for digit in pi_digits:
            current_number = current_number * 10 + int(digit)
            if current_number % n == 0:
                return current_number
        return None
    results = [first_divisible(n) for n in range(1, 21)]
    print(results)

Formula

a(n) = n * A088143(n). - Alois P. Heinz, Dec 05 2024

A377421 Numbers whose binary reversal is prime and unequal to the original number.

Original entry on oeis.org

6, 10, 11, 12, 13, 14, 20, 22, 23, 24, 25, 26, 28, 29, 34, 37, 40, 41, 43, 44, 46, 47, 48, 50, 52, 53, 55, 56, 58, 61, 62, 67, 68, 71, 74, 77, 80, 82, 83, 86, 88, 91, 92, 94, 96, 97, 100, 101, 104, 106, 110, 112, 113, 115, 116, 121, 122, 124, 131, 134, 136, 142
Offset: 1

Author

Simon R Blow, Oct 27 2024

Keywords

Comments

Contains A080790 and p*2^i for all primes p in A074832 union A080790 and i > 0. - Michael S. Branicky, Oct 29 2024

Examples

			6 = 110_2 is a term since reversed it is 011_2 = 3 which is prime.
7 = 111_2 is not a term since base 2 palindromic numbers are not included.
		

Crossrefs

Supersequence of A080790.

Programs

  • Mathematica
    Select[Range[142],PrimeQ[r=FromDigits[Reverse[IntegerDigits[#,2]],2]]&&r!=#&] (* James C. McMahon, Nov 18 2024 *)
  • Python
    from sympy import isprime
    def ok(n): return (b:=bin(n)[2:]) != (br:=b[::-1]) and isprime(int(br, 2))
    print([k for k in range(1, 143) if ok(k)]) # Michael S. Branicky, Oct 28 2024
    
  • Python
    # alternate program constructing terms directly from primes
    from sympy import primerange
    def auptobits(maxbits):
        alst = []
        for p in primerange(3, 1<Michael S. Branicky, Oct 29 2024

Formula

a = A204232 - A006995 (as sets). - Michael S. Branicky, Oct 29 2024

A365762 Greatest common divisor of n and the product of its digits.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 2, 1, 2, 5, 2, 1, 2, 1, 20, 1, 2, 1, 8, 5, 2, 1, 4, 1, 30, 1, 2, 3, 2, 5, 18, 1, 2, 3, 40, 1, 2, 1, 4, 5, 2, 1, 16, 1, 50, 1, 2, 1, 2, 5, 2, 1, 2, 1, 60, 1, 2, 9, 8, 5, 6, 1, 4, 3, 70, 1, 2, 1, 2, 5, 2, 7, 2, 1, 80, 1, 2, 1, 4, 5, 2, 1, 8, 1, 90, 1, 2, 3, 2, 5, 6, 1, 2, 9, 100
Offset: 1

Author

Simon R Blow, Sep 18 2023

Keywords

Comments

This sequence will contain all numbers whose prime factors are exclusively <10 (7-smooth numbers, A002473).

Examples

			a(11)=1 as 1*1=1; 11 and 1 share 1 as a gcd.
a(15)=5 as 1*5=5; 15 and 5 share 5 as a gcd.
a(10)=10 as 1*0=0; 10 and 0 share 10 as a gcd.
		

Crossrefs

Programs

  • Mathematica
    a[n_]:=GCD[n,Product[Part[IntegerDigits[n],i],{i,IntegerLength[n]}]]; Array[a,100] (* Stefano Spezia, Sep 20 2023 *)
  • PARI
    a(n) = gcd(n, vecprod(digits(n))); \\ Michel Marcus, Sep 20 2023
  • Python
    from math import gcd, prod
    def a(n): return gcd(n, prod(map(int, str(n))))
    print([a(n) for n in range(1, 101)])
    

A364786 We exclude powers of 10 and numbers of the form 11...111 in which the number of 1's is a power of 10. Then a(n) is the smallest number (not excluded) whose trajectory under iteration of "x -> sum of n-th powers of digits of x" reaches 1.

Original entry on oeis.org

19, 7, 112, 11123, 1111222, 111111245666689, 1111133333333335, 1111122333333333333333333346677777777888, 22222222222222222226666668888888, 233444445555555555555555555555555555555555555555555577, 1222222222233333333333333444444444455555555555555556666666666666666666666677778888889
Offset: 1

Author

Simon R Blow, Aug 07 2023

Keywords

Comments

For n!=2, it appears that the first step in the trajectory is always to a power of 10, so that the task would be to find the shortest and lexicographically smallest partition of a power of 10 into parts 1^n,...,9^n.

Examples

			a(1) = 19 since 1^1 + 9^1 = 10 and 1^1 + 0^1 = 1.
a(3) = 112 since 1^3 + 1^3 + 2^3 = 10 and 1^3 + 0^3 = 1.
		

Crossrefs

Extensions

a(6), a(8), and a(9) corrected by, and a(10) and a(11) from Jon E. Schoenfield, Aug 10 2023
Definition clarified by N. J. A. Sloane, Sep 15 2023

A364479 Happy palindromic primes.

Original entry on oeis.org

7, 313, 383, 11311, 15451, 30103, 30803, 35053, 36263, 71317, 74047, 94349, 94649, 95959, 98689, 1221221, 1257521, 1262621, 1281821, 1311131, 1444441, 1551551, 1594951, 1597951, 1658561, 1703071, 1737371, 1764671, 1829281, 1924291, 1957591, 1970791, 1981891, 1988891, 3001003
Offset: 1

Author

Simon R Blow, Jul 26 2023

Keywords

Comments

All terms in the sequence are prime numbers that read the same backward and forward. Each term is a happy number, meaning it converges to 1 under the process of repeatedly summing the squares of its digits. The sequence is a subset of both the palindromic prime numbers (A002385) and the happy numbers (A007770).
There are no happy palindromic primes with an even number of digits: every palindromic number with an even number of digits is divisible by 11, so 11 itself is the only palindromic prime, and it is not a happy number.

Examples

			313 is a term as it is palindromic (can be reversed), is a prime and is happy: 3^2 + 1^2 + 3^2 = 19, 1^2 + 9^2 = 82, 8^2 + 2^2 = 68, 6^2 + 8^2 = 100, 1^2 + 0^2 + 0^2 = 1.
		

Crossrefs

Intersection of A002385 and A007770.

Programs

  • Mathematica
    happyQ[n_] := NestWhile[Plus @@ (IntegerDigits[#]^2) &, n, UnsameQ, All] == 1; Select[Prime[Range[220000]], PalindromeQ[#] && happyQ[#] &] (* Amiram Eldar, Jul 28 2023 *)
  • Python
    def is_prime(num):
        return num > 1 and all(num % i != 0 for i in range(2, int(num ** 0.5) + 1))
    def is_palindrome(num):
        return str(num) == str(num)[::-1]
    def is_happy(num):
        while num != 1 and num != 4:
            num = sum(int(digit) ** 2 for digit in str(num))
        return num == 1
    happy_palindromic_primes = [num for num in range(1, 10000000) if is_prime(num) and is_palindrome(num) and is_happy(num)]
    print(happy_palindromic_primes)
    
  • Python
    from itertools import islice
    from sympy import isprime
    def A364479_gen(): # generator of terms
        n = 1
        while True:
            for z in (1,3,5,7,9):
                for y in range(z*n, (z+1)*n):
                    k, m = y//10, 0
                    while k >= 10:
                        k, r = divmod(k, 10)
                        m = 10*m + r
                    if isprime(a:=y*n + 10*m + k):
                        b = a
                        while b not in {1,37,58,89,145,42,20,4,16}:
                            b = sum((0, 1, 4, 9, 16, 25, 36, 49, 64, 81)[ord(d)-48] for d in str(b))
                        if b == 1:
                            yield a
            n *= 10
    A364479_list = list(islice(A364479_gen(),20)) # Chai Wah Wu, Aug 02 2023

A362584 Integers k > 1 such that k >= the square of the sum of their prime factors (A074373(k)).

Original entry on oeis.org

243, 256, 270, 288, 300, 320, 324, 336, 360, 375, 378, 384, 400, 405, 420, 432, 441, 448, 450, 480, 486, 490, 495, 500, 504, 512, 525, 528, 540, 550, 560, 567, 576, 585, 588, 594, 600, 616, 624, 625, 630, 640, 648, 650, 660, 672, 675, 686, 693, 700, 702, 704
Offset: 1

Author

Simon R Blow, Jun 23 2023

Keywords

Examples

			243 >= A001414(243)^2 = (3+3+3+3+3=15)^2 = 225 so 243 is a term.
800 >= A001414(800)^2 = (2+2+2+2+2+5+5=20)^2 = 400 so 800 is a term.
		

Crossrefs

Programs

  • Maple
    q:= n-> n>=add(i[1]*i[2], i=ifactors(n)[2])^2:
    select(q, [$2..800])[];  # Alois P. Heinz, Jun 23 2023
  • Mathematica
    Select[Range[2, 700], # >= (Plus @@ Times @@@ FactorInteger[#])^2 &] (* Amiram Eldar, Jun 24 2023 *)
  • PARI
    isok(n) = ((p=factor(n))[, 1]~*p[, 2])^2 <= n \\ Thomas Scheuerle, Jun 23 2023