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.

Showing 1-4 of 4 results.

A169739 a(n) = A030068(4n+1).

Original entry on oeis.org

1, 3, 6, 11, 17, 26, 37, 53, 70, 93, 119, 154, 191, 239, 292, 361, 431, 518, 611, 727, 846, 991, 1145, 1334, 1525, 1753, 1992, 2279, 2571, 2916, 3277, 3707, 4138, 4639, 5157, 5762, 6373, 7077, 7804, 8647, 9493, 10458, 11449, 12585, 13730, 15029, 16363, 17886, 19411
Offset: 0

Views

Author

N. J. A. Sloane, May 02 2010

Keywords

Crossrefs

Programs

  • Mathematica
    f[1]=1; f[n_?EvenQ]:=f[n]=f[n/2]; f[n_?OddQ]:=f[n]=f[n-1]+f[n-2]; a[n_]:=f[2*n+1]; Table[a[n], {n, 0, 100, 2}] (* Vincenzo Librandi, May 27 2019 *)

Formula

a(n) = A030067(4n-3). - George Beck, Jan 18 2020

A169740 a(n) = A030068(4n+3).

Original entry on oeis.org

2, 5, 9, 16, 23, 35, 48, 69, 87, 116, 145, 189, 228, 287, 345, 430, 501, 605, 704, 843, 965, 1136, 1299, 1523, 1716, 1981, 2231, 2566, 2863, 3261, 3638, 4137, 4569, 5140, 5675, 6367, 6984, 7781, 8531, 9490, 10339, 11423, 12440, 13721, 14875, 16328, 17697, 19409
Offset: 0

Views

Author

N. J. A. Sloane, May 02 2010

Keywords

Crossrefs

Programs

  • Mathematica
    f[1]=1; f[n_?EvenQ]:=f[n]=f[n/2]; f[n_?OddQ]:=f[n]=f[n-1]+f[n-2]; a[n_]:=f[4*n+3]; Table[a[n], {n, 0, 100}] (* Vincenzo Librandi, May 27 2019 *)
  • PARI
    {f(n) = if(n==1,1, if(n%2==0, f(n/2), f(n-1) + f(n-2)))};
    vector(50, n, n--; f(4*n+3)) \\ G. C. Greubel, May 29 2019
    
  • Sage
    def f(n):
        if (n==1): return 1
        elif (n%2==0): return f(n/2)
        else: return f(n-1) + f(n-2)
    [f(4*n+3) for n in (0..50)] # G. C. Greubel, May 29 2019

A030067 The "Semi-Fibonacci sequence": a(1) = 1; a(n) = a(n/2) (n even); a(n) = a(n-1) + a(n-2) (n odd).

Original entry on oeis.org

1, 1, 2, 1, 3, 2, 5, 1, 6, 3, 9, 2, 11, 5, 16, 1, 17, 6, 23, 3, 26, 9, 35, 2, 37, 11, 48, 5, 53, 16, 69, 1, 70, 17, 87, 6, 93, 23, 116, 3, 119, 26, 145, 9, 154, 35, 189, 2, 191, 37, 228, 11, 239, 48, 287, 5, 292, 53, 345, 16, 361, 69, 430, 1, 431, 70, 501, 17, 518, 87, 605, 6, 611, 93
Offset: 1

Views

Author

Keywords

Comments

This is the "semi-Fibonacci sequence". The distinct numbers that appear are called "semi-Fibonacci numbers", and are given in A030068.
a(2n+1) >= a(2n-1) + 1 is monotonically increasing. a(2n)/n can be arbitrarily small, as a(2^n) = 1. There are probably an infinite number of primes in the sequence. - Jonathan Vos Post, Mar 28 2006
From Robert G. Wilson v, Jan 17 2014: (Start)
Positions where k occurs:
k: sequence
-:-----------------------------
1: A000079;
2: 3*A000079 = A007283;
3: 5*A000079 = A020714;
4: none in the first 10^6 terms;
5: 7*A000079 = A005009;
6: 9*A000079 = A005010;
7: none in the first 10^6 terms;
8: none in the first 10^6 terms;
9: 11*A000079 = A005015;
10: none in the first 10^6 terms;
11: 13*A000079 = A005029;
12: none in the first 10^6 terms;
(End)
Any integer N which occurs in this sequence first occurs as an odd-indexed term a(2k-1) = A030068(k-1), and thereafter at indices (2k-1)*2^j, j=1,2,3,... (Both of these statements follow immediately from the definition of even-indexed terms.) No N can occur a second time as an odd-indexed term: This follows from the definition of these terms, a(2n+1) = a(2n) + a(2n-1) = a(2n-1) + a(n), which shows that the subsequence of odd-indexed terms (A030068) is strictly increasing, and therefore equal to the range (or: set) of the semi-Fibonacci numbers. - M. F. Hasler, Mar 24 2017
The lines in the logarithmic scatterplot of the sequence corresponds to sets of indices with the same 2-adic valuation. - Rémy Sigrist, Nov 27 2017
Define the partition subsum polynomial of an integer partition m of n where m = (m_1, m_2, ...m_k) by ps(m,x) = Product_{i=1..k} (1+x^m_i). Expanding ps(m,x) gives 1+a_1 x+a_2 x^2+...+a_n x^n, where a_j is the number of ways to form the subsum j from the parts of m. Then the number of partitions m of n for which ps(m,x) has no repeated root is a(n). - George Beck, Nov 07 2018

Examples

			a(1) = 1 by definition.
a(2) = a(1) = 1.
a(3) = 1 + 1 = 2.
a(4) = a(2) = 1.
a(5) = 2 + 1 = 3.
a(6) = a(3) = 2.
a(7) = 3 + 2 = 5.
a(8) = a(4) = 1.
a(9) = 5 + 1 = 6.
a(10) = a(5) = 3.
		

Crossrefs

See A109671 for a variant.

Programs

  • Haskell
    import Data.List (transpose)
    a030067 n = a030067_list !! (n-1)
    a030067_list = concat $ transpose [scanl (+) 1 a030067_list, a030067_list]
    -- Reinhard Zumkeller, Jul 21 2013, Jul 07 2013
    
  • Maple
    f:=proc(n) option remember; if n=1 then RETURN(1) elif n mod 2 = 0 then RETURN(f(n/2)) else RETURN(f(n-1)+f(n-2)); fi; end;
  • Mathematica
    semiFibo[1] = 1; semiFibo[n_?EvenQ] := semiFibo[n] = semiFibo[n/2]; semiFibo[n_?OddQ] := semiFibo[n] = semiFibo[n - 1] + semiFibo[n - 2]; Table[semiFibo[n], {n, 80}] (* Jean-François Alcover, Aug 19 2013 *)
  • PARI
    a(n) = if(n==1, 1, if(n%2 == 0, a(n/2), a(n-1) + a(n-2)));
    vector(100, n, a(n)) \\ Altug Alkan, Oct 12 2015
    
  • Python
    a=[1]; [a.append(a[-2]+a[-1] if n%2 else a[n//2-1]) for n in range(2, 75)]
    print(a) # Michael S. Branicky, Jul 07 2022

Formula

Theorem: a(2n+1) - a(2n-1) = a(n). Proof: a(2n+1) - a(2n-1) = a(2n) + a(2n-1) - a(2n-2) - a(2n-3) = a(n) - a(n-1) + a(n-1) (induction) = a(n). - N. J. A. Sloane, May 02 2010
a(2^n - 1) = A129092(n) for n >= 1, where A129092 forms the row sums and column 0 of triangle A129100, which is defined by the nice property that column 0 of matrix power A129100^(2^k) = column k of A129100 for k > 0. - Paul D. Hanna, Dec 03 2008
G.f. g(x) satisfies (1-x^2) g(x) = (1+x-x^2) g(x^2) + x. - Robert Israel, Mar 23 2017

A284282 a(n) = the number k such that A030067(2k-1) = n, or 0 if n does not occur in the semi-Fibonacci sequence A030067.

Original entry on oeis.org

0, 1, 2, 3, 0, 4, 5, 0, 0, 6, 0, 7, 0, 0, 0, 0, 8, 9, 0, 0, 0, 0, 0, 10, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18
Offset: 0

Views

Author

M. F. Hasler, Mar 24 2017

Keywords

Comments

Otherwise said, a(n) = round(m/2) = (m+1)/2, where m is the smallest index such that A030067(m) = n.
Any integer n which occurs in A030067 first occurs as an odd-indexed term A030067(2k-1) = A030068(k-1), and thereafter at indices (2k-1)*2^j, j=1,2,3,... (Both of these statements follow immediately from the definition of even-indexed terms of A030067.)
It is easy to see that no n can occur a second time as an odd-indexed term in A030067. This follows from the definition of these terms A030067(2k+1) = A030067(2k-1) + A030067(k), which shows that the subsequence of odd-indexed terms (A030068) is strictly increasing, and therefore equal to the range (or: set) of all semi-Fibonacci numbers.
Setting all nonzero terms to 1, this sequence is the characteristic function of A030068 (up to the offset).

Crossrefs

Cf. A030067 (semi-Fibonacci sequence), A030068 (bisection of odd-indexed terms, also equal to the range = set of all possible values or semi-Fibonacci numbers).

Programs

  • Mathematica
    a[n_] := a[n] = Which[n == 1, 1, EvenQ@ n, a[n/2], True, a[n - 1] + a[n - 2]]; With[{nn = 87}, Function[s, Function[t, {0}~Join~ReplacePart[t, Map[# -> First@ Lookup[s, #] &, TakeWhile[Keys@ s, # <= nn &]]]]@ ConstantArray[0, nn]]@ PositionIndex@ Array[a[2 # - 1] &, 10^3]] (* Michael De Vlieger, Mar 25 2017, Version 10, after Jean-François Alcover at A030067 *)
  • PARI
    A284282(n)=setsearch(A030068_vec,n) \\ Use, e.g., A030068(100) to compute the global variable A030068_vec far enough for n <= 22880. - M. F. Hasler, Mar 25 2017
Showing 1-4 of 4 results.