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: David Cleaver

David Cleaver's wiki page.

David Cleaver has authored 7 sequences.

A382130 Fractalization of the golden ratio.

Original entry on oeis.org

1, 1, 6, 1, 1, 6, 8, 1, 0, 1, 3, 6, 3, 8, 9, 1, 8, 0, 8, 1, 7, 3, 4, 6, 9, 3, 8, 8, 9, 9, 4, 1, 8, 8, 4, 0, 8, 8, 2, 1, 0, 7, 4, 3, 5, 4, 8, 6, 6, 9, 8, 3, 3, 8, 4, 8, 3, 9, 6, 9, 5, 4, 6, 1, 3, 8, 8, 8, 1, 4, 1, 0, 7, 8, 7, 8, 2, 2, 0, 1, 3, 0, 0, 7, 9, 4, 1, 3, 7, 5, 9, 4, 8, 8, 0
Offset: 1

Author

David Cleaver, Mar 16 2025

Keywords

Comments

Self-descriptive sequence: even indexed terms are the sequence itself, odd indexed terms are the decimal digits of the golden ratio.
This is an r1k1 fractal sequence, where r1k1 means: remove 1 term, keep 1 term, repeat. The Removed terms are the sequence that has been fractalized, and the Kept terms are the original fractal sequence.
This fractal sequence is not a Kimberling fractal sequence because if you delete the first occurrence of each term, the remaining sequence is not the same as the original.

Crossrefs

Bisection gives A001622 (odd part).

Formula

a(2n) = a(n); a(2n-1) = A001622(n), n >= 1.
a(n) = A001622(A003602(n)).

A382129 Fractalization of the prime numbers.

Original entry on oeis.org

2, 2, 3, 2, 5, 3, 7, 2, 11, 5, 13, 3, 17, 7, 19, 2, 23, 11, 29, 5, 31, 13, 37, 3, 41, 17, 43, 7, 47, 19, 53, 2, 59, 23, 61, 11, 67, 29, 71, 5, 73, 31, 79, 13, 83, 37, 89, 3, 97, 41, 101, 17, 103, 43, 107, 7, 109, 47, 113, 19, 127, 53, 131, 2, 137, 59, 139, 23, 149, 61, 151, 11, 157
Offset: 1

Author

David Cleaver, Mar 16 2025

Keywords

Comments

Self-descriptive sequence: even indexed terms are the sequence itself, odd indexed terms are the prime numbers.
This is an r1k1 fractal sequence, where r1k1 means: remove 1 term, keep 1 term, repeat. The Removed terms are the sequence that has been fractalized, and the Kept terms are the original fractal sequence.
This fractal sequence is also a Kimberling fractal sequence because if you delete the first occurrence of each term, the remaining sequence is the same as the original.

Programs

  • Mathematica
    a[n_] := Prime[(n/2^IntegerExponent[n, 2] + 1)/2]; Array[a, 100] (* Amiram Eldar, Mar 21 2025 *)

Formula

a(2n) = a(n); a(2n-1) = A000040(n), n >= 1.
a(n) = A000040(A003602(n)).

A382128 Fractalization of the Recamán sequence.

Original entry on oeis.org

0, 0, 1, 0, 3, 1, 6, 0, 2, 3, 7, 1, 13, 6, 20, 0, 12, 2, 21, 3, 11, 7, 22, 1, 10, 13, 23, 6, 9, 20, 24, 0, 8, 12, 25, 2, 43, 21, 62, 3, 42, 11, 63, 7, 41, 22, 18, 1, 42, 10, 17, 13, 43, 23, 16, 6, 44, 9, 15, 20, 45, 24, 14, 0, 46, 8, 79, 12, 113, 25, 78, 2, 114, 43, 77, 21, 39, 62, 78
Offset: 1

Author

David Cleaver, Mar 16 2025

Keywords

Comments

Self-descriptive sequence: even indexed terms are the sequence itself, odd indexed terms are the Recamán sequence.
This is an r1k1 fractal sequence, where r1k1 means: remove 1 term, keep 1 term, repeat. The Removed terms are the sequence that has been fractalized, and the Kept terms are the original fractal sequence.
This fractal sequence is not a Kimberling fractal sequence because if you delete the first occurrence of each term, the remaining sequence is not the same as the original. This sequence fails to be a Kimberling fractal due to having consecutive terms that both appeared earlier in the sequence, starting with the 1 and 42 at index 48 and 49, respectively.

Formula

a(2n) = a(n); a(2n-1) = A005132(n), n >= 1.
a(n) = A005132(A003602(n)).

A362680 a(n) is the number of decimal digits in A173426(n).

Original entry on oeis.org

1, 3, 5, 7, 9, 11, 13, 15, 17, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64, 68, 72, 76, 80, 84, 88, 92, 96, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 144, 148, 152, 156, 160, 164, 168, 172, 176, 180, 184, 188, 192, 196, 200, 204, 208, 212, 216, 220, 224, 228, 232
Offset: 1

Author

David Cleaver, Apr 29 2023

Keywords

Examples

			a(12)=28 since 1234567891011121110987654321 has 28 digits.
		

Crossrefs

Programs

  • Mathematica
    a[n_]:=IntegerLength[FromDigits[Flatten[IntegerDigits/@Join[Range[n], Reverse[Range[n-1]]]]]]; Array[a,63] (* Stefano Spezia, Apr 16 2025 *)
  • PARI
    a(n)={my(t=logint(n,10)+1); 2*n*t-2*(10^t-1)/9+t}
    
  • Python
    def a(n): return ((n*(t:=len(str(n)))-(10**t-1)//9)<<1) + t
    print([a(n) for n in range(1, 64)]) # Michael S. Branicky, May 02 2023

Formula

a(n) = A058183(n) + A058183(n-1), for n >= 2.
a(n) = A055642(A173426(n)).
a(n) = 2*A058183(n) - A055642(n).

A358275 Least prime factor of A098129(n).

Original entry on oeis.org

2, 71, 2, 5, 2, 1141871, 2, 3, 2, 58728589, 2, 3, 2, 5, 2, 3, 2, 277, 2, 4643, 2, 29, 2, 5, 2, 3, 2, 37, 2, 3, 2, 13, 2, 3, 2, 264439098646852541, 2, 7, 2, 53, 2, 7, 2, 3, 2, 587, 2, 3, 2, 45307, 2, 3, 2, 5, 2, 11, 2, 7, 2, 13, 2, 3, 2, 5, 2, 3, 2, 17, 2, 3, 2, 983, 2, 5, 2, 53, 2, 11
Offset: 2

Author

David Cleaver, Mar 26 2023

Keywords

Examples

			a(3) = 71 because 71 is the smallest prime factor of A098129(3) = 122333.
a(7) = 1141871 because 1141871 is the smallest prime factor of A098129(7) = 1223334444555556666667777777.
		

Crossrefs

Programs

  • Python
    from sympy import primefactors
    def A358275(n): return min(primefactors(int(''.join(str(j)*j for j in range(1,n+1))))) if n&1 else 2 # Chai Wah Wu, Apr 15 2023

Formula

a(n) = A020639(A098129(n)).
a(n) = 2 if n is even. - Chai Wah Wu, Apr 15 2023

A361751 a(n) is the number of decimal digits in A098129(n) and A300517(n).

Original entry on oeis.org

1, 3, 6, 10, 15, 21, 28, 36, 45, 65, 87, 111, 137, 165, 195, 227, 261, 297, 335, 375, 417, 461, 507, 555, 605, 657, 711, 767, 825, 885, 947, 1011, 1077, 1145, 1215, 1287, 1361, 1437, 1515, 1595, 1677, 1761, 1847, 1935, 2025, 2117, 2211, 2307, 2405, 2505, 2607, 2711, 2817, 2925
Offset: 1

Author

David Cleaver, Mar 23 2023

Keywords

Examples

			For n = 4, a(4) = 10, because A098129(4) = 1223334444.
For n = 10, a(10) = 65, because A098129(10) = 12233344445555566666677777778888888899999999910101010101010101010.
		

Crossrefs

Partial sums of A110803.

Programs

  • Maple
    a:= proc(n) a(n):= `if`(n<1, 0, a(n-1)+n*length(n)) end:
    seq(a(n), n=1..100);  # Alois P. Heinz, Mar 23 2023
  • PARI
    a(n) = {my(x=logint(n,10)+1);x*n*(n+1)/2 - ((100^x-1)/99 - (10^x-1)/9)/2}
    vector(100, i, a(i))
    
  • Python
    def a(n):
        d = len(str(n))
        m = 10**d
        return d*n*(n+1)//2 - ((m-11)*m + 10)//198
    print([a(n) for n in range(1, 55)]) # Michael S. Branicky, Mar 24 2023 modified Mar 29 2023
    
  • Python
    # faster for generating initial segment of sequence
    from itertools import count, islice
    def agen(s=0): yield from (s:=s+n*len(str(n)) for n in count(1))
    print(list(islice(agen(), 60))) # Michael S. Branicky, Mar 24 2023

Formula

a(n) = A055642(A098129(n)).
From Alois P. Heinz, Mar 23 2023: (Start)
a(n) = Sum_{j=1..n} j*A055642(j).
a(n) = Sum_{j=1..n} A110803(j). (End)
a(n) = Sum_{k=0..floor(log_10(n))} (n*(n+1) - 10^k*(10^k-1))/2. - Andrew Howroyd, Mar 24 2023
a(n) = k*n*(n+1)/2 - ((100^k-1)/99 - (10^k-1)/9)/2, where k = floor(log_10(n))+1. - David Cleaver, Mar 25 2023

A322250 Take binary expansion of 2n-1 and delete the trailing block of 1's, except if the number is 11...1, leave a single 1.

Original entry on oeis.org

1, 1, 2, 1, 4, 2, 6, 1, 8, 4, 10, 2, 12, 6, 14, 1, 16, 8, 18, 4, 20, 10, 22, 2, 24, 12, 26, 6, 28, 14, 30, 1, 32, 16, 34, 8, 36, 18, 38, 4, 40, 20, 42, 10, 44, 22, 46, 2, 48, 24, 50, 12, 52, 26, 54, 6, 56, 28, 58, 14, 60, 30, 62, 1, 64
Offset: 1

Author

David Cleaver, Nov 30 2018

Keywords

Comments

This is a fractal sequence because removing the first occurrence of each number in the sequence will leave the original sequence behind.
One can repeat this process and always get back the original sequence, i.e., this sequence contains itself an infinite number of times. This is equivalent to removing the odd-indexed entries and getting back the original sequence.
Fractal sequence listing the smallest positive ancestor of the odd positive integers, where ancestor(n) = (n-1)/2 if n>1 is odd or n if n is 1 or even.

Examples

			a(3) = 2 because the 3rd odd integer 5 equals 101 in binary, and removing the least significant consecutive 1's gives us 10 in binary = 2 in decimal.
a(4) = 1 because the 4th odd integer 7 equals 111 in binary, and removing all except the initial 1 gives us 1 in binary = 1 in decimal.
a(5) = 4 because the 5th odd integer 9 equals 1001 in binary, and removing the least significant consecutive 1's gives us 100 in binary = 4 in decimal.
a(6) = 2 because the 6th odd integer 11 equals 1011 in binary, and removing the least significant consecutive 1's gives us 10 in binary = 2 in decimal.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := n/2^IntegerExponent[n, 2]; a[n_] := Module[{f1=f[n]}, If[f1==1, 1, f1-1]]; Array[a, 60] (* Amiram Eldar, Dec 01 2018 *)
  • PARI
    print_list(n)={my(i);for(i=1,n,print1(max(1,i>>valuation(i,2)-1),","));}
    
  • PARI
    a(n)={max(1, n>>valuation(n,2)-1)} \\ Andrew Howroyd, Dec 01 2018
    
  • Python
    def print_list(n):
      for i in range(1,n,2):
        z=i
        while z>1 and z%2 == 1:
          z = (z-1)/2
        print(z)
    def a(n):
      z = 2*n - 1
      while z>1 and z%2 == 1:
        z = (z-1)/2
      print(z)
    
  • Python
    def A322250(n):
        s = bin(2*n-1)[2:].rstrip('1')
        return int(s,2) if s != '' else 1 # Chai Wah Wu, Jan 02 2019

Formula

a(n) = A000265(n)-1, unless A000265(n) = 1 in which case a(n) = 1.
a(n) = if n is 1 then 1, else if n is odd then n-1, else a(n/2).
a(n) = max(1, A153733(n-1)). - Rémy Sigrist, Dec 01 2018