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-3 of 3 results.

A256220 Number of times that the numerator of a sum generated from the set 1, 1/2, 1/3,..., 1/n is a Fibonacci number.

Original entry on oeis.org

1, 3, 5, 9, 11, 22, 28, 37, 45, 62, 70, 125, 133, 172, 330, 421, 450, 840, 901, 1710, 2356, 2724, 2824, 5367, 6022, 7142, 8072, 18771, 19204, 35739, 36453, 42853, 82094, 88574, 155642, 264869
Offset: 1

Views

Author

Michel Lagneau, Mar 19 2015

Keywords

Comments

Note that for each n there are only 2^(n-1) new sums to consider. For the number of distinct Fibonacci numbers, see A256221. For the largest generated Fibonacci number, see A256222. For the smallest Fibonacci number not generated, see A256223.

Examples

			a(3) = 5 because we obtain 5 following subsets {1}, {1/2}, {1/3}, {1,1/2} and {1/2, 1/3} having 5 sums with Fibonacci numerators: 1, 1, 1, 1+1/2 = 3/2 and 1/2+1/3 = 5/6.
		

Crossrefs

Programs

  • Mathematica
    <<"DiscreteMath`Combinatorica`"; maxN=22; For[cnt=0; i=0; n=1, n<=maxN, n++, While[i<2^n-1, i++; s=NthSubset[i, Range[n]]; k=Numerator[Plus@@(1/s)]; If[IntegerQ[Sqrt[5*k^2+4]]||IntegerQ[Sqrt[5*k^2-4]], cnt++ ]]; Print[cnt]]
  • Python
    from math import gcd, lcm
    from itertools import combinations
    def A256220(n):
        m = lcm(*range(1,n+1))
        fibset, mlist = set(), tuple(m//i for i in range(1,n+1))
        a, b, c, k = 0, 1, 0, sum(mlist)
        while b <= k:
            fibset.add(b)
            a, b = b, a+b
        for l in range(1,n//2+1):
            for p in combinations(mlist,l):
                s = sum(p)
                if s//gcd(s,m) in fibset:
                    c += 1
                if 2*l != n and (k-s)//gcd(k-s,m) in fibset:
                    c += 1
        return c+int(k//gcd(k,m) in fibset) # Chai Wah Wu, Feb 15 2022

Extensions

a(23)-a(36) from Lars Blomberg, May 06 2015

A256221 Number of distinct nonzero Fibonacci numbers in the numerator of the 2^n sums generated from the set 1, 1/2, 1/3, ..., 1/n.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 8, 8, 8, 12, 12, 13, 13, 13, 13, 15, 15, 15, 17, 17, 17, 19, 21, 21, 23, 24, 25, 25, 25, 25, 25, 27
Offset: 1

Views

Author

Michel Lagneau, Mar 19 2015

Keywords

Comments

For the largest generated Fibonacci number, see A256222. For the smallest Fibonacci number not generated, see A256223.

Examples

			a(4) = 4 because 4 sums yield distinct Fibonacci numerators: 1, 1 + 1/2 = 3/2, 1/2 + 1/3 = 5/6 and 1/2 + 1/3 + 1/4 = 13/12.
		

Crossrefs

Programs

  • Maple
    S:= {0,1}: N:= {1}:
    nfibs:= 10:
    fibs:= {seq(combinat:-fibonacci(n),n=1..nfibs)}:
    A[1]:= 1:
    fibnums:= {1}:
    for n from 2 to 24 do
        Sp:= map(`+`,S,1/n);
        N:= N union map(numer, Sp);
      Nmax:= max(N);
      S:= S union Sp;
      while combinat:-fibonacci(nfibs) < Nmax do nfibs:= nfibs+1; fibs:= fibs union {combinat:-fibonacci(nfibs)} od;
      newfibnums:= N intersect fibs;
      fibnums:= newfibnums;
      A[n]:= nops(fibnums);
    od:
    seq(A[n],n=1..24); # Robert Israel, Dec 09 2016
  • Mathematica
    <<"DiscreteMath`Combinatorica`";maxN=23; For[prms={}; i=0; n=1, n<=maxN, n++, While[i<2^n-1, i++; s=NthSubset[i, Range[n]]; k=Numerator[Plus@@(1/s)]; If[IntegerQ[Sqrt[5*k^2+4]]||IntegerQ[Sqrt[5*k^2-4]],prms=Union[prms, {k}]]]; Print[Length[prms]]]
  • Python
    from math import gcd, lcm
    from itertools import combinations
    def A256221(n):
        m = lcm(*range(1,n+1))
        fset, fibset, mlist = set(), set(), tuple(m//i for i in range(1,n+1))
        a, b, k = 0, 1, sum(mlist)
        while b <= k:
            fibset.add(b)
            a, b = b, a+b
        for l in range(1,n//2+1):
            for p in combinations(mlist,l):
                s = sum(p)
                if (t := s//gcd(s,m)) in fibset:
                    fset.add(t)
                if 2*l != n and (t := (k-s)//gcd(k-s,m)) in fibset:
                    fset.add(t)
        if (t:= k//gcd(k,m)) in fibset: fset.add(t)
        return len(fset) # Chai Wah Wu, Feb 15 2022

Extensions

Corrected and more terms added by Robert Israel, Dec 09 2016
a(29)-a(31) from Chai Wah Wu, Feb 15 2022
a(32) from Chai Wah Wu, Feb 16 2022

A256222 Largest Fibonacci number in the numerator of the 2^n sums generated from the set 1, 1/2, 1/3, ..., 1/n.

Original entry on oeis.org

0, 1, 3, 5, 13, 13, 13, 89, 89, 89, 1597, 1597, 1597, 1597, 1597, 1597, 17711, 17711, 17711, 28657, 28657, 28657, 28657, 1346269, 1346269, 1346269, 1346269, 24157817, 24157817, 24157817, 24157817, 24157817, 24157817, 39088169, 39088169, 39088169, 39088169
Offset: 0

Views

Author

Michel Lagneau, Mar 19 2015

Keywords

Comments

The prime Fibonacci numbers in the sequence are 3, 5, 13, 89, 1597, 28657, ...
For information about how often the numerator of these sums is a Fibonacci number, see A256220 and A256221.

Examples

			a(3) = 5 because we obtain the 5 subsets {1}, {1/2}, {1/3}, {1,1/2} and {1/2, 1/3} having 5 sums with Fibonacci numerators: 1, 1, 1, 1+1/2 = 3/2 and 1/2+1/3 = 5/6 => the greatest Fibonacci number is 5.
		

Crossrefs

Programs

  • Mathematica
    <<"DiscreteMath`Combinatorica`"; maxN=24; For[t={}; mx=0; i=0; n=0, n<=maxN, n++, While[i<2^n-1, i++; s=NthSubset[i, Range[n]]; k=Numerator[Plus@@(1/s)]; If[IntegerQ[Sqrt[5*k^2+4]]||IntegerQ[Sqrt[5*k^2-4]], If[k>mx, t=s]; mx=Max[mx, k]]]; Print[mx]]

Extensions

Corrected and extended by Alois P. Heinz, Mar 25 2015
a(30)-a(36) from Hiroaki Yamanouchi, Mar 30 2015
Showing 1-3 of 3 results.