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

A175654 Eight bishops and one elephant on a 3 X 3 chessboard. G.f.: (1 - x - x^2)/(1 - 3*x - x^2 + 6*x^3).

Original entry on oeis.org

1, 2, 6, 14, 36, 86, 210, 500, 1194, 2822, 6660, 15638, 36642, 85604, 199626, 464630, 1079892, 2506550, 5811762, 13462484, 31159914, 72071654, 166599972, 384912086, 888906306, 2052031172, 4735527306, 10925175254, 25198866036, 58108609526, 133973643090
Offset: 0

Views

Author

Johannes W. Meijer, Aug 06 2010; edited Jun 21 2013

Keywords

Comments

a(n) represents the number of n-move routes of a fairy chess piece starting in a given corner square (m = 1, 3, 7 or 9) on a 3 X 3 chessboard. This fairy chess piece behaves like a bishop on the eight side and corner squares but on the center square the bishop flies into a rage and turns into a raging elephant.
In chaturanga, the old Indian version of chess, one of the pieces was called gaja, elephant in Sanskrit. The Arabs called the game shatranj and the elephant became el fil in Arabic. In Spain chess became chess as we know it today but surprisingly in Spanish a bishop isn't a Christian bishop but a Moorish elephant and it still goes by its original name of el alfil.
On a 3 X 3 chessboard there are 2^9 = 512 ways for an elephant to fly into a rage on the central square (off the center the piece behaves like a normal bishop). The elephant is represented by the A[5] vector in the fifth row of the adjacency matrix A, see the Maple program and A180140. For the corner squares the 512 elephants lead to 46 different elephant sequences, see the overview of elephant sequences and the crossreferences.
The sequence above corresponds to 16 A[5] vectors with decimal values 71, 77, 101, 197, 263, 269, 293, 323, 326, 329, 332, 353, 356, 389, 449 and 452. These vectors lead for the side squares to A000079 and for the central square to A175655.

References

  • Gary Chartrand, Introductory Graph Theory, pp. 217-221, 1984.
  • David Hooper and Kenneth Whyld, The Oxford Companion to Chess, pp. 74, 366, 1992.

Crossrefs

Cf. Elephant sequences corner squares [decimal value A[5]]: A040000 [0], A000027 [16], A000045 [1], A094373 [2], A000079 [3], A083329 [42], A027934 [11], A172481 [7], A006138 [69], A000325 [26], A045623 [19], A000129 [21], A095121 [170], A074878 [43], A059570 [15], A175654 [71, this sequence], A026597 [325], A097813 [58], A057711 [27], 2*A094723 [23; n>=-1], A002605 [85], A175660 [171], A123203 [186], A066373 [59], A015518 [341], A134401 [187], A093833 [343].

Programs

  • Magma
    [n le 3 select Factorial(n) else 3*Self(n-1) +Self(n-2) -6*Self(n-3): n in [1..41]]; // G. C. Greubel, Dec 08 2021
    
  • Maple
    nmax:=28; m:=1; A[1]:=[0,0,0,0,1,0,0,0,1]: A[2]:=[0,0,0,1,0,1,0,0,0]: A[3]:=[0,0,0,0,1,0,1,0,0]: A[4]:=[0,1,0,0,0,0,0,1,0]: A[5]:=[0,0,1,0,0,0,1,1,1]: A[6]:=[0,1,0,0,0,0,0,1,0]: A[7]:=[0,0,1,0,1,0,0,0,0]: A[8]:=[0,0,0,1,0,1,0,0,0]: A[9]:=[1,0,0,0,1,0,0,0,0]: A:=Matrix([A[1], A[2], A[3], A[4], A[5], A[6], A[7], A[8], A[9]]): for n from 0 to nmax do B(n):=A^n: a(n):= add(B(n)[m,k],k=1..9): od: seq(a(n), n=0..nmax);
  • Mathematica
    LinearRecurrence[{3,1,-6}, {1,2,6}, 80] (* Vladimir Joseph Stephan Orlovsky, Feb 21 2012 *)
  • PARI
    a(n)=([0,1,0; 0,0,1; -6,1,3]^n*[1;2;6])[1,1] \\ Charles R Greathouse IV, Oct 03 2016
    
  • Sage
    [( (1-x-x^2)/((1-2*x)*(1-x-3*x^2)) ).series(x,n+1).list()[n] for n in (0..40)] # G. C. Greubel, Dec 08 2021

Formula

G.f.: (1 - x - x^2)/(1 - 3*x - x^2 + 6*x^3).
a(n) = 3*a(n-1) + a(n-2) - 6*a(n-3) with a(0)=1, a(1)=2 and a(2)=6.
a(n) = ((6+10*A)*A^(-n-1) + (6+10*B)*B^(-n-1))/13 - 2^n with A = (-1+sqrt(13))/6 and B = (-1-sqrt(13))/6.
Limit_{k->oo} a(n+k)/a(k) = (-1)^(n)*2*A000244(n)/(A075118(n) - A006130(n-1)*sqrt(13)).
a(n) = b(n) - b(n-1) - b(n-2), where b(n) = Sum_{k=1..n} Sum_{j=0..k} binomial(j,n-3*k+2*j)*(-6)^(k-j)*binomial(k,j)*3^(3*k-n-j), n>0, b(0)=1, with a(0) = b(0), a(1) = b(1) - b(0). - Vladimir Kruchinin, Aug 20 2010
a(n) = 2*A006138(n) - 2^n = 2*(A006130(n) + A006130(n-1)) - 2^n. - G. C. Greubel, Dec 08 2021
E.g.f.: 2*exp(x/2)*(13*cosh(sqrt(13)*x/2) + 3*sqrt(13)*sinh(sqrt(13)*x/2))/13 - cosh(2*x) - sinh(2*x). - Stefano Spezia, Feb 12 2023

A075189 Number of distinct primes 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, 6, 14, 20, 38, 74, 134, 232, 486, 526, 1078, 2036, 2505, 4762, 9929, 14598, 29831, 31521, 52223, 101123, 207892, 215796, 426772, 836665, 1640357, 1689653, 3401483, 3471770, 6868800, 13470379, 23182192, 45792615, 47136366
Offset: 1

Views

Author

T. D. Noe, Sep 08 2002

Keywords

Comments

Every prime is generated eventually. For the largest generated prime, see A075226. For the smallest odd prime not generated, see A075227.
A217712(n) = number of primes occurring exactly once as numerators among the 2^n sums. - Reinhard Zumkeller, Jun 02 2013

Examples

			a(3) = 3 because 3 sums yield distinct prime numerators: 1+1/2 = 3/2, 1/2+1/3 = 5/6 and 1+1/2+1/3 = 11/6.
		

Crossrefs

Programs

  • Haskell
    import Data.Ratio ((%), numerator)
    import Data.Set (Set, empty, fromList, toList, union, size)
    a075189 n = a075189_list !! (n-1)
    a075189_list = f 1 empty empty where
       f x s s1 = size s1' : f (x + 1) (s `union` fromList hs) s1' where
         s1' = s1 `union` fromList
               (filter ((== 1) . a010051') $ map numerator hs)
         hs = map (+ 1 % x) $ 0 : toList s
    -- Reinhard Zumkeller, May 28 2013
  • Mathematica
    Needs["DiscreteMath`Combinatorica`"]; maxN=20; For[lst={}; 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[PrimeQ[k], prms=Union[prms, {k}]]]; AppendTo[lst, Length[prms]]]; lst

Extensions

a(21)-a(29) from Reinhard Zumkeller, May 28 2013
a(30)-a(35) from Sean A. Irvine, Feb 10 2025

A075226 Largest prime in the numerator of the 2^n sums generated from the set 1, 1/2, 1/3,..., 1/n.

Original entry on oeis.org

3, 11, 19, 137, 137, 1019, 2143, 7129, 7129, 78167, 81401, 1085933, 1111673, 1165727, 2364487, 41325407, 41325407, 796326437, 809074601, 812400209, 822981689, 19174119571, 19652175721, 99554817251, 100483070801
Offset: 2

Views

Author

T. D. Noe, Sep 08 2002

Keywords

Comments

For the smallest odd prime not generated, see A075227. For information about how often the numerator of these sums is prime, see A075188 and A075189. The Mathematica program also prints the subset that yields the largest prime. For n <=20, the largest prime occurs in a sum of n-2, n-1, or n reciprocals.

Examples

			a(3) =11 because 11 is largest prime numerator in the three sums that yield primes: 1+1/2 = 3/2, 1/2+1/3 = 5/6 and 1+1/2+1/3 = 11/6.
		

Crossrefs

Programs

  • Haskell
    import Data.Ratio (numerator)
    a075226 n = a075226_list !! (n-1)
    a075226_list = f 2 [recip 1] where
       f x hs = (maximum $ filter ((== 1) . a010051') (map numerator hs')) :
                f (x + 1) hs' where hs' = hs ++ map (+ recip x) hs
    -- Reinhard Zumkeller, May 28 2013
    
  • Mathematica
    Needs["DiscreteMath`Combinatorica`"]; maxN=20; For[t={}; lst={}; mx=0; i=0; n=2, n<=maxN, n++, While[i<2^n-1, i++; s=NthSubset[i, Range[n]]; k=Numerator[Plus@@(1/s)]; If[PrimeQ[k], If[k>mx, t=s]; mx=Max[mx, k]]]; Print[n, " ", t]; AppendTo[lst, mx]]; lst
    Table[Max[Select[Numerator[Total/@Subsets[1/Range[n],{2,2^n}]],PrimeQ]],{n,2,30}] (* The program will take a long time to run. *) (* Harvey P. Dale, Jan 08 2019 *)
  • PARI
    See Fuller link.
    
  • Python
    from math import gcd, lcm
    from itertools import combinations
    from sympy import isprime
    def A075226(n):
        m = lcm(*range(1,n+1))
        c, mlist = 0, tuple(m//i for i in range(1,n+1))
        for l in range(n,-1,-1):
            if sum(mlist[:l]) < c:
                break
            for p in combinations(mlist,l):
                s = sum(p)
                s //= gcd(s,m)
                if s > c and isprime(s):
                    c = s
        return c # Chai Wah Wu, Feb 14 2022

Extensions

More terms from Martin Fuller, Jan 19 2008

A075227 Smallest odd prime not occurring in the numerator of any of the 2^n subset sums generated from the set 1/1, 1/2, 1/3, ..., 1/n.

Original entry on oeis.org

3, 5, 7, 17, 37, 43, 43, 151, 151, 409, 491, 491, 491, 1087, 2011, 3709, 3709, 7417, 7417, 7417, 19699, 30139, 35573, 35573, 40237, 40237, 132151, 132151, 158551, 158551, 245639, 245639, 961459, 1674769, 1674769, 1674769, 1674769, 4339207
Offset: 1

Views

Author

T. D. Noe, Sep 08 2002

Keywords

Comments

The largest prime generated is given in A075226. For information about how often the numerator of these sums is prime, see A075188 and A075189.

Examples

			a(3) = 7 because 7 is the smallest prime not occurring in the numerator of any of the sums 1/1 + 1/2 = 3/2, 1/1 + 1/3 = 4/3, 1/2 + 1/3 = 5/6 and 1/1 + 1/2 + 1/3 = 11/6.
		

Crossrefs

Programs

  • Haskell
    import Data.Ratio ((%), numerator)
    import Data.Set (Set, empty, fromList, toList, union)
    a075227 n = a075227_list !! (n-1)
    a075227_list = f 1 empty a065091_list where
       f x s ps = head qs : f (x + 1) (s `union` fromList hs) qs where
         qs = foldl (flip del)
              ps $ filter ((== 1) . a010051') $ map numerator hs
         hs = map (+ 1 % x) $ 0 : toList s
       del u vs'@(v:vs) = case compare u v
                          of LT -> vs'; EQ -> vs; GT -> v : del u vs
    -- Reinhard Zumkeller, May 28 2013
    
  • Mathematica
    Needs["DiscreteMath`Combinatorica`"]; maxN=20; For[lst={}; 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[PrimeQ[k], AppendTo[prms, k]]]; prms=Union[prms]; j=2; While[MemberQ[prms, Prime[j]], j++ ]; AppendTo[lst, Prime[j]]]; lst
    (* Second program; does not need Combinatorica *)
    a[1] = 3; a[2] = 5; a[n_] := For[nums = (Total /@ Subsets[1/Range[n]]) // Numerator // Union // Select[#, PrimeQ]&; p = 3, p <= Last[nums], p = NextPrime[p], If[FreeQ[nums, p], Print[n, " ", p]; Return[p]]];
    Table[a[n], {n, 1, 23}] (* Jean-François Alcover, Sep 10 2017 *)
  • Python
    from sympy import sieve
    from fractions import Fraction
    fracs, newnums, primeset = {0}, {0}, set(sieve.primerange(3, 10**6+1))
    for n in range(1, 24):
      newfracs = set(Fraction(1, n) + f for f in fracs)
      fracs |= newfracs
      primeset -= set(f.numerator for f in newfracs)
      print(min(primeset), end=", ") # Michael S. Branicky, May 09 2021

Extensions

a(21)-a(28) from Reinhard Zumkeller, May 28 2013
a(29)-a(33) from Jon E. Schoenfield, May 09 2021
a(34)-a(36) from Michael S. Branicky, May 10 2021
a(37)-a(38) from Michael S. Branicky, May 12 2021

A217712 Number of primes occurring exactly once as numerators in sums generated from the set 1, 1/2, 1/3,..., 1/n.

Original entry on oeis.org

0, 1, 3, 3, 11, 13, 27, 54, 106, 168, 378, 142, 733, 1597, 1283, 3418, 8204, 10112, 24644, 7829, 32866, 78136, 178741, 37002, 256392, 650596, 1402914, 286854, 2053463
Offset: 1

Views

Author

Reinhard Zumkeller, Jun 02 2013

Keywords

Comments

For information about how often the numerator of the generated sums is prime, see A075188 and A075189; for the largest generated prime, see A075226; for the smallest odd prime not generated, see A075227.

Examples

			For n=3 there are the following fractions as sums of 1, 1/2 and 1/3:
{1/3, 1/2, 5/6, 1, 4/3, 3/2, 11/6}, three numerators are prime and they occur exactly once, therefore a(3) = A075188(3) = A075189(3) = #{3, 5, 11} = 3;
n=4: adding 1/4 to the previous fractions gives together: 1/4, 1/3, 1/2, 1/3+1/4=7/12, 1/2+1/4=3/4, 5/6, 1, 5/6+1/4=13/12, 1+1/4=5/4, 4/3, 3/2, 4/3+1/4=19/12, 3/2+1/4=7/4, 11/6 and 11/6+1/4=25/12:
A075188(4) = #{7/12, 3/4, 5/6, 13/12, 5/4, 3/2, 19/12, 7/4, 11/6} = 9,
A075189(4) = #{3, 5, 7, 11, 13, 19} = 6,
a(4) = #{11, 13, 19} = 3.
		

Crossrefs

Cf. A010051.

Programs

  • Haskell
    import Data.Ratio ((%), numerator)
    import Data.Set (Set, empty, fromList, toList, union, size)
    import Data.Set (member, delete, insert)
    a217712 n = a217712_list !! (n-1)
    a217712_list = f 1 empty empty where
       f x s s1 = size s1' : f (x + 1) (s `union` fromList hs) s1' where
         s1' = g s1 $ filter ((== 1) . a010051') $ map numerator hs
         g v []                    = v
         g v (w:ws) | w `member` v = g (delete w v) ws
                    | otherwise    = g (insert w v) ws
         hs = map (+ 1 % x) $ 0 : toList s

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
Showing 1-6 of 6 results.