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.

Previous Showing 11-18 of 18 results.

A130252 Partial sums of A130250.

Original entry on oeis.org

0, 1, 4, 7, 11, 15, 20, 25, 30, 35, 40, 45, 51, 57, 63, 69, 75, 81, 87, 93, 99, 105, 112, 119, 126, 133, 140, 147, 154, 161, 168, 175, 182, 189, 196, 203, 210, 217, 224, 231, 238, 245, 252, 259, 267, 275, 283, 291, 299, 307, 315, 323, 331, 339, 347, 355, 363, 371
Offset: 0

Views

Author

Hieronymus Fischer, May 20 2007

Keywords

Comments

If the initial zero is omitted, partial sums of A130253.

Crossrefs

Programs

  • Magma
    A001045:= func< n | (2^n - (-1)^n)/3 >;
    A130252:= func< n | n eq 0 select 0 else (2*n*Ceiling(Log(2, 3*n-1)) - A001045(Ceiling(Log(2,3*n-1)) +1) +1)/2 >;
    [A130252(n): n in [0..70]]; // G. C. Greubel, Mar 18 2023
    
  • Mathematica
    A001045[n_]:= (2^n - (-1)^n)/3;
    A130252[n_]:= If[n==0, 0, (2*n*Ceiling[Log[2,3*n-1]] - A001045[Ceiling[Log[2,3*n-1]]+1] +1)/2];
    Table[A130252[n], {n,0,70}] (* G. C. Greubel, Mar 18 2023 *)
  • Python
    def A130252(n): return n*(m:=(3*n-1).bit_length())-(((1<>1) # Chai Wah Wu, Apr 17 2025
  • SageMath
    def A001045(n): return (2^n - (-1)^n)/3
    def A130252(n): return 0 if (n==0) else (2*n*ceil(log(3*n-1,2)) - A001045(ceil(log(3*n-1,2)) +1) +1)/2
    [A130252(n) for n in range(71)] # G. C. Greubel, Mar 18 2023
    

Formula

a(n) = Sum_{k=0..n} A130250(k).
a(n) = n*ceiling(log_2(3n-1)) - (1/2)*( A001045(ceiling(log_2(3n-1)) +1) - 1 ).
G.f.: (1/(1-x)^2)*Sum_{k>=0} x^A001045(k).

A130250 Minimal index k of a Jacobsthal number such that A001045(k) >= n (the 'upper' Jacobsthal inverse).

Original entry on oeis.org

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

Views

Author

Hieronymus Fischer, May 20 2007

Keywords

Comments

Inverse of the Jacobsthal sequence (A001045), nearly, since a(A001045(n))=n except for n=2 (see A130249 for another version). a(n+1) is equal to the partial sum of the Jacobsthal indicator sequence (see A105348).

Examples

			a(10)=5 because A001045(5) = 11 >= 10, but A001045(4) = 5 < 10.
		

Crossrefs

For partial sums see A130252.

Programs

  • Magma
    [0] cat [Ceiling(Log(2,3*n-1)): n in [1..120]]; // G. C. Greubel, Mar 18 2023
    
  • Mathematica
    Table[If[n==0, 0, Ceiling[Log[2, 3*n-1]]], {n,0,120}] (* G. C. Greubel, Mar 18 2023 *)
  • Python
    def A130250(n): return (3*n-2).bit_length() if n else 0 # Chai Wah Wu, Apr 17 2025
  • SageMath
    def A130250(n): return 0 if (n==0) else ceil(log(3*n-1, 2))
    [A130250(n) for n in range(121)] # G. C. Greubel, Mar 18 2023
    

Formula

a(n) = ceiling(log_2(3n-1)) = 1 + floor(log_2(3n-2)) for n >= 1.
a(n) = A130249(n-1) + 1 = A130253(n-1) for n >= 1.
G.f.: (x/(1-x))*Sum_{k>=0} x^A001045(k).

A372288 Array read by upward antidiagonals: A(n, k) = A265745(A372282(n, k)), n,k >= 1, where A265745(n) is the sum of digits in "Jacobsthal greedy base".

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 3, 3, 1, 1, 1, 3, 3, 1, 1, 1, 1, 3, 3, 3, 3, 1, 1, 1, 1, 3, 3, 1, 3, 1, 1, 1, 1, 3, 1, 1, 3, 3, 1, 1, 1, 1, 1, 1, 1, 5, 3, 3, 1, 1, 1, 1, 1, 1, 1, 3, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 5, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 3, 5, 3
Offset: 1

Views

Author

Antti Karttunen, Apr 28 2024

Keywords

Comments

Collatz conjecture is equal to the claim that each column will eventually settle to constant 1's, somewhere under its topmost row. This works as only the bisection A002450 of Jacobsthal numbers (A001045) contains numbers of the form 4k+1, while the other bisection contains only numbers of the form 4k+3, which do not occur among the range of A372351. See also the comments in A371094.

Examples

			Array begins:
n\k| 1  2  3  4  5  6  7  8  9 10 11 12 13     14 15    16 17 18 19 20    21 22
---+----------------------------------------------------------------------------
1  | 1, 1, 1, 3, 3, 1, 3, 3, 3, 3, 1, 3, 3,     3, 3,    3, 3, 3, 3, 5,    5, 1,
2  | 1, 1, 1, 3, 3, 3, 1, 3, 3, 3, 1, 5, 5,     5, 3,    5, 3, 3, 3, 5,    5, 3,
3  | 1, 1, 1, 3, 3, 3, 1, 5, 1, 3, 1, 3, 3,     5, 3,    5, 5, 1, 3, 3,    5, 3,
4  | 1, 1, 1, 3, 3, 1, 1, 3, 1, 3, 1, 1, 3,     5, 3,    3, 3, 1, 3, 5,    5, 3,
5  | 1, 1, 1, 1, 3, 1, 1, 1, 1, 3, 1, 1, 3,     5, 1,    5, 3, 1, 3, 3,    3, 3,
6  | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3,     3, 1,    5, 3, 1, 1, 5,    5, 3,
7  | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,     5, 1,    3, 3, 1, 1, 3,    5, 3,
8  | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,     5, 1,    5, 1, 1, 1, 3,    3, 3,
9  | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,     3, 1,    5, 1, 1, 1, 3,    5, 1,
10 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,     5, 1,    5, 1, 1, 1, 3,    5, 1,
11 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,     5, 1, 2155, 1, 1, 1, 1,    5, 1,
12 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,     5, 1,    5, 1, 1, 1, 1, 6251, 1,
13 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 10347, 1,    5, 1, 1, 1, 1,    5, 1,
14 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,     5, 1,    5, 1, 1, 1, 1,    5, 1,
15 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,     5, 1,    7, 1, 1, 1, 1,    5, 1,
16 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,     5, 1,    5, 1, 1, 1, 1,    7, 1,
		

Crossrefs

Cf. also array A372561 (formed by columns whose indices in this array are given by A372443).

Programs

A130247 Inverse Lucas (A000032) numbers: index k of a Lucas number such that Lucas(k)=n; max(k|Lucas(k) < n), if there is no such index.

Original entry on oeis.org

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

Views

Author

Hieronymus Fischer, May 19 2007, Jul 02 2007

Keywords

Comments

Inverse of the Lucas sequence (A000032), since a(Lucas(n))=n for n >= 0 (see A130241 and A130242 for other versions). Same as A130241 except for n=1.

Examples

			a(2)=0, since Lucas(0)=2; a(10)=4, since Lucas(4) = 7 < 10 but Lucas(5) = 11 > 10.
		

Crossrefs

For partial sums see A130248. Other related sequences: A000032, A130241, A130242, A130245, A130249, A130255, A130259. Indicator sequence A102460. For Fibonacci inverse see A130233 - A130240, A104162.

Programs

  • Mathematica
    Join[{1, 0}, Table[Floor[Log[GoldenRatio, n + 1/2]], {n, 3, 50}]] (* G. C. Greubel, Dec 21 2017 *)
  • Python
    from itertools import islice, count
    def A130247_gen(): # generator of terms
        yield from (1,0)
        a, b = 3, 4
        for i in count(2):
            yield from (i,)*(b-a)
            a, b = b, a+b
    A130247_list = list(islice(A130247_gen(),40)) # Chai Wah Wu, Jun 08 2022

Formula

a(n)=c(n), if (n^2-4)/5 is a square number, a(n)=s(n), if (n^2+4)/5 is a square number and a(n)=floor(log_phi(n)) otherwise, where s(n)=floor(arcsinh(n/2)/log(phi)), c(n)=floor(arccosh(n/2)/log(phi)) and phi=(1+sqrt(5))/2.
a(n) = A130241(n) except for n=2.
G.f.: g(x) = (1/(1-x))*(Sum_{k>=1} x^Lucas(k)) - x^2.
a(n) = floor(log_phi(n+1/2)) for n >= 3, where phi is the golden ratio.

A372555 Least number of Jacobsthal numbers that add up to n.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, May 07 2024

Keywords

Comments

Differs from A265745 for the first time at n=63, where a(63) = 3, while A265745(63) = 5. The next differences occur at n=84, 148, 169, 191, 212, 234, 255, etc. See A372557.
See conjecture in A372556, and also in A372561.

Examples

			a(5) = 1, because 5 is itself in A001045.
a(7) = 3, because 7 can be expressed as a sum of three Jacobsthal numbers, either as 5+1+1 or 3+3+1, but not as a sum of two Jacobsthal numbers, and neither 7 is itself in A001045.
a(63) = 3, because the least number of Jacobsthal numbers that add up to 63 is obtained when we use A001045(6) = 21 three times, as 21+21+21 = 63. This is the first time this sequence differs from A265745.
		

Crossrefs

Programs

  • PARI
    up_to = 87381; \\ = A001045(18).
    A001045(n) = (2^n - (-1)^n) / 3;
    A130249(n) = (#binary(3*n+1)-1);
    A372555_or_556list(up_to_n,return_556_instead) = { my(v372555 = vector(up_to_n), v372556 = vector(up_to_n)); v372555[1] = 1; v372556[1] = 2; for(n=2,#v372556, my(m=-1,mk=-1,s=A130249(n)); if(A001045(s)==n, v372555[n] = 1; v372556[n] = s, forstep(k=s, 1, -1, my(c=v372555[n-A001045(k)]); if(m<0 || cA001045(mk)])); if(return_556_instead,v372556,v372555); };
    v372555 = A372555_or_556list(up_to,0);
    A372555(n) = if(!n,n,v372555[n]);
    
  • Scheme
    ;; An implementation of memoization-macro definec can be found for example in: http://oeis.org/wiki/Memoization
    (definec (A001045 n) (if (<= n 1) n (+ (A001045 (- n 1)) (* 2 (A001045 (- n 2))))))
    (define (A130249 n) (floor->exact (/ (log (+ 1 (* 3 n))) (log 2))))
    (define (A147612 n) (if (<= n 1) 1 (if (= (A001045 (A130249 n)) n) 1 0)))
    (definec (A372555 n) (if (<= n 1) n (+ 1 (A372555 (- n (A001045 (A372556 n)))))))
    (definec (A372556 n) (let ((k (A130249 n))) (if (= 1 (A147612 n)) k (let loop ((k k) (m #f) (mk #f)) (cond ((zero? k) mk) (else (let* ((c (A372555 (- n (A001045 k))))) (if (or (not m) (< c m)) (loop (- k 1) c k) (loop (- k 1) m mk)))))))))

Formula

a(0) = 0, a(1) = 1; for n > 1, a(n) = 1 + a(n-A001045(A372556(n))).

A265746 Jacobsthal greedy base (A265747) interpreted as base-3 numbers, then shown in decimal.

Original entry on oeis.org

0, 1, 2, 3, 4, 9, 10, 11, 12, 13, 18, 27, 28, 29, 30, 31, 36, 37, 38, 39, 40, 81, 82, 83, 84, 85, 90, 91, 92, 93, 94, 99, 108, 109, 110, 111, 112, 117, 118, 119, 120, 121, 162, 243, 244, 245, 246, 247, 252, 253, 254, 255, 256, 261, 270, 271, 272, 273
Offset: 0

Views

Author

Antti Karttunen, Dec 17 2015

Keywords

Comments

Analogously to "Fibbinary numbers" (A003714) and "Catquaternary numbers" (A244161), this sequence could be called "Jacoternary numbers".

Crossrefs

Programs

Formula

a(0) = 0; for n >= 1, a(n) = 3^(A130249(n)-2) + a(n - A001045(A130249(n))).

A372557 Numbers k such that the least number of Jacobsthal numbers that add up to k, A372555(k), is less than the number needed with the greedy algorithm, A265745(k).

Original entry on oeis.org

63, 84, 148, 169, 191, 212, 234, 255, 276, 297, 319, 340, 404, 425, 489, 510, 532, 553, 575, 596, 617, 638, 660, 681, 703, 724, 746, 767, 788, 809, 831, 852, 874, 895, 917, 937, 938, 959, 980, 1002, 1022, 1023, 1044, 1065, 1087, 1108, 1129, 1150, 1172, 1193, 1215, 1236, 1258, 1278, 1279, 1300, 1321, 1343, 1363, 1364, 1428
Offset: 1

Views

Author

Antti Karttunen, May 07 2024

Keywords

Examples

			63 = 21+21+21 has A372555(63)=3 for its optimal, non-greedy solution, and A265745(63) = 5 for its greedy solution 63 = 43+11+5+3+1, therefore 63 is included in this sequence. (From _Yuriko Suwa_'s Jul 11 2021 comment in A265745.)
84 = 21+21+21+21 has A372555(84)=4 for its optimal, non-greedy solution, and A265745(84) = 6 for its greedy solution 84 = 43+21+11+5+3+1, therefore 84 is included in this sequence.
169 = 85+21+21+21+21 has A372555(169)=5 for its optimal, non-greedy solution, and A265745(169) = 7 for its greedy solution 169 = 85+43+21+11+5+3+1, therefore 169 is included in this sequence.
		

Crossrefs

Cf. A372558 (subsequence).

Programs

A372561 Array read by upward antidiagonals: A(n, k) = A265745(A372560(n, k)) for n > 1, k >= 1.

Original entry on oeis.org

3, 5, 5, 5, 5, 3, 5, 5, 5, 3, 5, 5, 5, 5, 5, 3, 3, 3, 3, 3, 3, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 10347, 6251, 2155, 1131, 619, 363, 235, 107, 43, 27, 11, 7, 5
Offset: 1

Views

Author

Antti Karttunen, May 08 2024

Keywords

Comments

In general, it seems that for n>2, k>1, A(n, k) = A(n-1, k+1) = A(k, n), except on those two anomalous antidiagonals, first on the thirteenth antidiagonal, where for n=1..13, A(n,14-n) obtains values 5, 7, 11, 27, 43, 107, 235, 363, 619, 1131, 2155, 6251, 10347, and then on the 30th antidiagonal, where for n=1.., A(n,31-n) obtains values 5, 11, 15, 23, 39, 71, 135, 391, 647, 1671, 2695, 4743, 17031, 33415, 49799, 82567, 148103, 410247, etc. The corresponding antidiagonals in A372560 begin as:
233, 933, 14933, 978670933, 64138178286933, 1183140560213014108063589658350933, ..., and:
911, 58325, 933205, 238900565, 15656587449685, 67244531063362552157525, etc. I conjecture that for the former sequence of numbers x, from 933 onward, A372555(x) = 7, and for the latter sequence of numbers y, from 58325 onward, A372555(y) = 9, and that the array A372555(A372560(n, k)) is symmetric apart from its borders, i.e, that for n, k > 1, A372555(A372560(n, k)) = A372555(A372560(k, n)).

Examples

			Array begins:
n\k| 1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21
---+----------------------------------------------------------------
1  | 3, 5, 3, 3, 5, 3, 5, 5, 3, 5, 5, 5, 5, 3, 5, 3, 7, 5, 7, 5, 5,
2  | 5, 5, 5, 5, 3, 5, 5, 3, 5, 5, 5, 7, 5, 5, 5, 7, 5, 7, 7, 5, 5,
3  | 5, 5, 5, 3, 5, 5, 3, 5, 5, 5, 11, 5, 5, 5, 7, 5, 7, 7, 5, 5, 7,
4  | 5, 5, 3, 5, 5, 3, 5, 5, 5, 27, 5, 5, 5, 7, 5, 7, 7, 5, 5, 7, 9,
5  | 5, 3, 5, 5, 3, 5, 5, 5, 43, 5, 5, 5, 7, 5, 7, 7, 5, 5, 7, 9, 7,
6  | 3, 5, 5, 3, 5, 5, 5, 107, 5, 5, 5, 7, 5, 7, 7, 5, 5, 7, 9, 7, 7,
7  | 5, 5, 3, 5, 5, 5, 235, 5, 5, 5, 7, 5, 7, 7, 5, 5, 7, 9, 7, 7, 7,
8  | 5, 3, 5, 5, 5, 363, 5, 5, 5, 7, 5, 7, 7, 5, 5, 7, 9, 7, 7, 7, 9,
9  | 3, 5, 5, 5, 619, 5, 5, 5, 7, 5, 7, 7, 5, 5, 7, 9, 7, 7, 7, 9, 7,
10 | 5, 5, 5, 1131, 5, 5, 5, 7, 5, 7, 7, 5, 5, 7, 9, 7, 7, 7, 9, 7, 1671,
11 | 5, 5, 2155, 5, 5, 5, 7, 5, 7, 7, 5, 5, 7, 9, 7, 7, 7, 9, 7, 2695, 3,
12 | 5, 6251, 5, 5, 5, 7, 5, 7, 7, 5, 5, 7, 9, 7, 7, 7, 9, 7, 4743, 3, 5,
13 | 10347, 5, 5, 5, 7, 5, 7, 7, 5, 5, 7, 9, 7, 7, 7, 9, 7, 17031, 3, 5, 3,
14 | 5, 5, 5, 7, 5, 7, 7, 5, 5, 7, 9, 7, 7, 7, 9, 7, 33415, 3, 5, 3, 5,
15 | 5, 5, 7, 5, 7, 7, 5, 5, 7, 9, 7, 7, 7, 9, 7, 49799, 3, 5, 3, 5, 5,
etc.
From column 19 to column 41, the first 11 rows:
n\k|19 20 ........................................................... 40 41
---+-------------------------------------------------------------------------
1  | 7, 5, 5, 5, 7, 7, 5, 5, 5, 7, 7, 5,    3, 3, 3, 5, 5, 5, 5, 3, 3, 3, 1,
2  | 7, 5, 5, 7, 9, 7, 7, 7, 9, 7, 11,   3, 5, 3, 5, 5, 5, 5, 3, 5, 3, 1, 1,
3  | 5, 5, 7, 9, 7, 7, 7, 9, 7, 15,   3, 5, 3, 5, 5, 5, 5, 3, 5, 3, 1, 1, 1,
4  | 5, 7, 9, 7, 7, 7, 9, 7, 23,   3, 5, 3, 5, 5, 5, 5, 3, 5, 3, 1, 1, 1, 1,
5  | 7, 9, 7, 7, 7, 9, 7, 39,   3, 5, 3, 5, 5, 5, 5, 3, 5, 3, 1, 1, 1, 1, 1,
6  | 9, 7, 7, 7, 9, 7, 71,   3, 5, 3, 5, 5, 5, 5, 3, 5, 3, 1, 1, 1, 1, 1, 1,
7  | 7, 7, 7, 9, 7, 135,  3, 5, 3, 5, 5, 5, 5, 3, 5, 3, 1, 1, 1, 1, 1, 1, 1,
8  | 7, 7, 9, 7, 391,  3, 5, 3, 5, 5, 5, 5, 3, 5, 3, 1, 1, 1, 1, 1, 1, 1, 1,
9  | 7, 9, 7, 647,  3, 5, 3, 5, 5, 5, 5, 3, 5, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1,
10 | 9, 7, 1671, 3, 5, 3, 5, 5, 5, 5, 3, 5, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
11 | 7, 2695, 3, 5, 3, 5, 5, 5, 5, 3, 5, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
		

Crossrefs

Programs

Previous Showing 11-18 of 18 results.