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 21-30 of 106 results. Next

A005165 Alternating factorials: n! - (n-1)! + (n-2)! - ... 1!.

Original entry on oeis.org

0, 1, 1, 5, 19, 101, 619, 4421, 35899, 326981, 3301819, 36614981, 442386619, 5784634181, 81393657019, 1226280710981, 19696509177019, 335990918918981, 6066382786809019, 115578717622022981, 2317323290554617019, 48773618881154822981
Offset: 0

Views

Author

Keywords

Comments

Conjecture: for n > 2, smallest prime divisor of a(n) > n. - Gerald McGarvey, Jun 19 2004
Rebuttal: This is not true; see Zivkovic link (Math. Comp. 68 (1999), pp. 403-409) has demonstrated that 3612703 divides a(n) for all n >= 3612702. - Paul Jobling, Oct 18 2004
Conjecture: For n>1, a(n) is the number of lattice paths from (0,0) to (n+1,0) that do not cross above y=x or below the x-axis using up-steps +(1,a) and down-steps +(1,-b) where a and b are positive integers. For example, a(3) = 5: [(1,1)(1,1)(1,1)(1,-3)], [(1,1)(1,-1)(1,3)(1,-3)], [(1,1)(1,-1)(1,2)(1,-2)], [(1,1)(1,-1)(1,1)(1,-1)] and [(1,1)(1,1)(1,-1)(1,-1)]. - Nicholas Ham, Aug 23 2015
Ham's claim is true for n=2. We proceed with a proof for n>2 by induction. On the j-th step, from (j-1,y) to (j,y'), there are j options for y': 0, 1, ..., y-1, y+1, ..., j. Thus there are n! possible paths from (0,0) to x=n that stay between y=0 and y=x. (Then the final step is determined.) However, because +(1,0) is not an allowable step, we cannot land on (n,0) on the n-th step. Therefore, the number of acceptable lattice paths is n! - a(n-1). - Danny Rorabaugh, Nov 30 2015

References

  • Richard K. Guy, Unsolved Problems in Number Theory, 3rd Edition, Springer, 2004, Section B10, pp. 152-153.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • GAP
    List([0..30],n->Sum([1..n],i->(-1)^(n-i)*Factorial(i))); # Muniru A Asiru, Jun 01 2018
  • Haskell
    a005165 n = a005165_list !! n
    a005165_list = 0 : zipWith (-) (tail a000142_list) a005165_list
    -- Reinhard Zumkeller, Jul 21 2013
    
  • Maple
    A005165 := proc(n) local i; add((-1)^(n-i)*i!,i=1..n); end;
  • Mathematica
    nn=25;With[{fctrls=Range[nn]!},Table[Abs[Total[Times@@@Partition[ Riffle[ Take[ fctrls,n],{1,-1}],2]]],{n,nn}]] (* Harvey P. Dale, Dec 10 2011 *)
    a[0] = 0; a[n_] := n! - a[n - 1]; Array[a, 26, 0] (* Robert G. Wilson v, Aug 06 2012 *)
    RecurrenceTable[{a[n] == n! - a[n - 1], a[0] == 0}, a, {n, 0, 20}] (* Eric W. Weisstein, Jul 27 2017 *)
    AlternatingFactorial[Range[0, 20]] (* Eric W. Weisstein, Jul 27 2017 *)
    a[n_] = (-1)^n (Exp[1]((-1)^n Gamma[-1-n,1] Gamma[2+n] - ExpIntegralEi[-1]) - 1)
    Table[a[n] // FullSimplify, {n, 0, 20}] (* Gerry Martens, May 22 2018 *)
  • PARI
    a(n)=if(n<0,0,sum(k=0,n-1,(-1)^k*(n-k)!))
    
  • PARI
    first(m)=vector(m,j,sum(i=0,j-1,((-1)^i)*(j-i)!)) \\ Anders Hellström, Aug 23 2015
    
  • PARI
    a(n)=round((-1)^n*(exp(1)*(gamma(n+2)*incgam(-1-n,1)*(-1)^n +eint1(1))-1)) \\ Gerry Martens, May 22 2018
    
  • Python
    a = 0
    f = 1
    for n in range(1, 33):
        print(a, end=",")
        f *= n
        a = f - a
    # Alex Ratushnyak, Aug 05 2012
    

Formula

a(0) = 0, a(n) = n! - a(n-1) for n > 0; also a(n) = n*a(n-2) + (n-1)*a(n-1) for n > 1. Sum_{n>=1} Pi^n/a(n) ~ 30.00005. - Gerald McGarvey, Jun 19 2004
E.g.f.: 1/(1-x) + exp(-x)*(e*(Ei(1,1)-Ei(1,1-x)) - 1). - Robert Israel, Dec 01 2015
a(n) = (-1)^n*(exp(1)*(gamma(n+2)*gamma(-1-n,1)*(-1)^n +Ei(1))-1). - Gerry Martens, May 22 2018
Sum_{n>=1} 1/a(n) = A343187. - Amiram Eldar, Jun 01 2023

A006843 Triangle read by rows: row n gives denominators of Farey series of order n.

Original entry on oeis.org

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

Views

Author

Keywords

Examples

			0/1, 1/1;
0/1, 1/2, 1/1;
0/1, 1/3, 1/2, 2/3, 1/1;
0/1, 1/4, 1/3, 1/2, 2/3, 3/4, 1/1;
0/1, 1/5, 1/4, 1/3, 2/5, 1/2, 3/5, 2/3, 3/4, 4/5, 1/1;
... = A006842/A006843.
		

References

  • J. H. Conway and R. K. Guy, The Book of Numbers, Copernicus Press, NY, 1996, p. 152.
  • Martin Gardner, The Last Recreations, Chapter 12: Strong Laws of Small Primes, Springer-Verlag, 1997, pp. 191-205, especially p. 199.
  • G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers. 3rd ed., Oxford Univ. Press, 1954, p. 23.
  • W. J. LeVeque, Topics in Number Theory. Addison-Wesley, Reading, MA, 2 vols., 1956, Vol. 1, p. 154.
  • A. O. Matveev, Farey Sequences, De Gruyter, 2017.
  • I. Niven and H. S. Zuckerman, An Introduction to the Theory of Numbers. 2nd ed., Wiley, NY, 1966, p. 141.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Row n has A005728(n) terms. - Michel Marcus, Jun 27 2014
Row sums give A240877.
Cf. A006842 (numerators), A049455, A049456, A007305, A007306.
See also A177405/A177407.

Programs

  • Maple
    Farey := proc(n) sort(convert(`union`({0},{seq(seq(m/k,m=1..k),k=1..n)}),list)) end: seq(denom(Farey(i)),i=1..5); # Peter Luschny, Apr 28 2009
  • Mathematica
    Farey[n_] := Union[ Flatten[ Join[{0}, Table[a/b, {b, n}, {a, b}]]]]; Flatten[ Table[ Denominator[ Farey[n]], {n, 9}]] (* Robert G. Wilson v, Apr 08 2004 *)
    Table[Denominator[FareySequence[n]],{n,10}]//Flatten (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Oct 04 2016 *)
  • PARI
    row(n) = {vf = [0]; for (k=1, n, for (m=1, k, vf = concat(vf, m/k););); vf = vecsort(Set(vf)); for (i=1, #vf, print1(denominator(vf[i]), ", "));} \\ Michel Marcus, Jun 27 2014

Extensions

More terms from Robert G. Wilson v, Apr 08 2004
Changed offset (=order of first row) to 1 by R. J. Mathar, Apr 26 2009

A005235 Fortunate numbers: least m > 1 such that m + prime(n)# is prime, where p# denotes the product of all primes <= p.

Original entry on oeis.org

3, 5, 7, 13, 23, 17, 19, 23, 37, 61, 67, 61, 71, 47, 107, 59, 61, 109, 89, 103, 79, 151, 197, 101, 103, 233, 223, 127, 223, 191, 163, 229, 643, 239, 157, 167, 439, 239, 199, 191, 199, 383, 233, 751, 313, 773, 607, 313, 383, 293, 443, 331, 283, 277, 271, 401, 307, 331
Offset: 1

Views

Author

Keywords

Comments

Reo F. Fortune conjectured that a(n) is always prime.
You might be searching for Fortunate Primes, which is an alternative name for this sequence. It is not the official name yet, because it is possible, although unlikely, that not all the terms are primes. - N. J. A. Sloane, Sep 30 2020
The first 500 terms are primes. - Robert G. Wilson v. The first 2000 terms are primes. - Joerg Arndt, Apr 15 2013
The strong form of Cramér's conjecture implies that a(n) is a prime for n > 1618, as previously noted by Golomb. - Charles R Greathouse IV, Jul 05 2011
a(n) is the smallest m such that m > 1 and A002110(n) + m is prime. For every n, a(n) must be greater than prime(n+1) - 1. - Farideh Firoozbakht, Aug 20 2003
If a(n) < prime(n+1)^2 then a(n) is prime. According to Cramér's conjecture a(n) = O(prime(n)^2). - Thomas Ordowski, Apr 09 2013
Conjectures from Pierre CAMI, Sep 08 2017: (Start)
If all terms are prime, then lim_{N->oo} (Sum_{n=1..N} primepi(a(n))) / (Sum_{n=1..N} n) = 3/2, and primepi(a(n))/n < 6 for all n.
Limit_{N->oo} (Sum_{n=1..N} a(n)) / (Sum_{n=1..N} prime(n)) = Pi/2.
a(n)/prime(n) < 8 for all n. (End)
Conjecture: Limit_{N->oo} (Sum_{n=1..N} a(n)) / (Sum_{n=1..N} prime(n)) = 3/2. - Alain Rocchelli, Dec 24 2022
The name "Fortunate numbers" was coined by Golomb (1981) after the New Zealand social anthropologist Reo Franklin Fortune (1903 - 1979). According to Golomb, Fortune's conjecture first appeared in print in Martin Gardner's Mathematical Games column in 1980. - Amiram Eldar, Aug 25 2020

Examples

			a(4) = 13 because P_4# = 2*3*5*7 = 210, plus one is 211, the next prime is 223 and the difference between 210 and 223 is 13.
		

References

  • Martin Gardner, The Last Recreations, Chapter 12: Strong Laws of Small Primes, Springer-Verlag, 1997, pp. 191-205, especially pp. 194-195.
  • Richard K. Guy, Unsolved Problems in Number Theory, 3rd ed., Springer, 1994, Section A2, p. 11.
  • Stephen P. Richards, A Number For Your Thoughts, 1982, p. 200.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, pages 114-115.
  • David Wells, Prime Numbers: The Most Mysterious Figures In Math, Hoboken, New Jersey: John Wiley & Sons (2005), pp. 108-109.

Crossrefs

Programs

  • Haskell
    a005235 n = head [m | m <- [3, 5 ..], a010051'' (a002110 n + m) == 1]
    -- Reinhard Zumkeller, Apr 02 2014
    
  • Maple
    Primorial:= 2:
    p:= 2:
    A[1]:= 3:
    for n from 2 to 100 do
      p:= nextprime(p);
      Primorial:= Primorial * p;
      A[n]:= nextprime(Primorial+p+1)-Primorial;
    od:
    seq(A[n],n=1..100); # Robert Israel, Dec 02 2015
  • Mathematica
    NPrime[n_Integer] := Module[{k}, k = n + 1; While[! PrimeQ[k], k++]; k]; Fortunate[n_Integer] := Module[{p, q}, p = Product[Prime[i], {i, 1, n}] + 1; q = NPrime[p]; q - p + 1]; Table[Fortunate[n], {n, 60}]
    r[n_] := (For[m = (Prime[n + 1] + 1)/2, ! PrimeQ[Product[Prime[k], {k, n}] + 2 m - 1], m++]; 2 m - 1); Table[r[n], {n, 60}]
    FN[n_] := Times @@ Prime[Range[n]]; Table[NextPrime[FN[k] + 1] - FN[k], {k, 60}] (* Jayanta Basu, Apr 24 2013 *)
    NextPrime[#]-#+1&/@(Rest[FoldList[Times,1,Prime[Range[60]]]]+1) (* Harvey P. Dale, Dec 15 2013 *)
  • PARI
    a(n)=my(P=prod(k=1,n,prime(k)));nextprime(P+2)-P \\ Charles R Greathouse IV, Jul 15 2011; corrected by Jean-Marc Rebert, Jul 28 2015
    
  • Python
    from sympy import nextprime, primorial
    def a(n): psharp = primorial(n); return nextprime(psharp+1) - psharp
    print([a(n) for n in range(1, 59)]) # Michael S. Branicky, Jan 15 2022
  • Sage
    def P(n): return prod(nth_prime(k) for k in range(1, n + 1))
    it = (P(n) for n in range(1, 31))
    print([next_prime(Pn + 2) - Pn for Pn in it]) # F. Chapoton, Apr 28 2020
    

Formula

If x(n) = 1 + Product_{i=1..n} prime(i), q(n) = least prime > x(n), then a(n) = q(n) - x(n) + 1.
a(n) = 1 + the difference between the n-th primorial plus one and the next prime.
a(n) = A035345(n) - A002110(n). - Jonathan Sondow, Dec 02 2015

A006842 Triangle read by rows: row n gives numerators of Farey series of order n.

Original entry on oeis.org

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

Views

Author

Keywords

Examples

			0/1, 1/1;
0/1, 1/2, 1/1;
0/1, 1/3, 1/2, 2/3, 1/1;
0/1, 1/4, 1/3, 1/2, 2/3, 3/4, 1/1;
0/1, 1/5, 1/4, 1/3, 2/5, 1/2, 3/5, 2/3, 3/4, 4/5, 1/1;
... = A006842/A006843
		

References

  • A. H. Beiler, Recreations in the Theory of Numbers, Dover, NY, 1964
  • J. H. Conway and R. K. Guy, The Book of Numbers, Copernicus Press, NY, 1996, p. 152.
  • L. E. Dickson, History of the Theory of Numbers. Carnegie Institute Public. 256, Washington, DC, Vol. 1, 1919; Vol. 2, 1920; Vol. 3, 1923. See Vol. 1.
  • Guthery, Scott B. A motif of mathematics. Docent Press, 2011.
  • G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers. 3rd ed., Oxford Univ. Press, 1954, p. 23.
  • W. J. LeVeque, Topics in Number Theory. Addison-Wesley, Reading, MA, 2 vols., 1956, Vol. 1, p. 154.
  • A. O. Matveev, Farey Sequences, De Gruyter, 2017.
  • I. Niven and H. S. Zuckerman, An Introduction to the Theory of Numbers. 2nd ed., Wiley, NY, 1966, p. 141.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Row n has A005728(n) terms. - Michel Marcus, Jun 27 2014
Cf. A006843 (denominators), A049455, A049456, A007305, A007306. Also A177405/A177407.

Programs

  • Maple
    Farey := proc(n) sort(convert(`union`({0},{seq(seq(m/k,m=1..k),k=1..n)}),list)) end: seq(numer(Farey(i)),i=1..5); # Peter Luschny, Apr 28 2009
  • Mathematica
    Farey[n_] := Union[ Flatten[ Join[{0}, Table[a/b, {b, n}, {a, b}]]]]; Flatten[ Table[ Numerator[ Farey[n]], {n, 0, 9}]] (* Robert G. Wilson v, Apr 08 2004 *)
    Table[FareySequence[n] // Numerator, {n, 1, 9}] // Flatten (* Jean-François Alcover, Sep 25 2018 *)
  • PARI
    row(n) = {vf = [0]; for (k=1, n, for (m=1, k, vf = concat(vf, m/k););); vf = vecsort(Set(vf)); for (i=1, #vf, print1(numerator(vf[i]), ", "));} \\ Michel Marcus, Jun 27 2014

Extensions

More terms from Robert G. Wilson v, Apr 08 2004

A002407 Cuban primes: primes which are the difference of two consecutive cubes.

Original entry on oeis.org

7, 19, 37, 61, 127, 271, 331, 397, 547, 631, 919, 1657, 1801, 1951, 2269, 2437, 2791, 3169, 3571, 4219, 4447, 5167, 5419, 6211, 7057, 7351, 8269, 9241, 10267, 11719, 12097, 13267, 13669, 16651, 19441, 19927, 22447, 23497, 24571, 25117, 26227, 27361, 33391
Offset: 1

Views

Author

Keywords

Comments

Primes of the form p = (x^3 - y^3)/(x - y) where x=y+1. See A007645 for generalization. I first saw the name "cuban prime" in Cunningham (1923). Values of x are in A002504 and y are in A111251. - N. J. A. Sloane, Jan 29 2013
Prime hex numbers (cf. A003215).
Equivalently, primes of the form p=1+3k(k+1) (and then k=floor(sqrt(p/3))). Also: primes p such that n^2(p+n) is a cube for some n>0. - M. F. Hasler, Nov 28 2007
Primes p such that 4p = 1+3s^2 for some integer s (A121259). - Michael Somos, Sep 15 2005
This sequence is believed to be infinite. - N. J. A. Sloane, May 07 2020

Examples

			a(1) = 7 = 1+3k(k+1) (with k=1) is the smallest prime of this form.
a(10^5) = 1792617147127 since this is the 100000th prime of this form.
		

References

  • Allan Joseph Champneys Cunningham, On quasi-Mersennian numbers, Mess. Math., 41 (1912), 119-146.
  • Allan Joseph Champneys Cunningham, Binomial Factorisations, Vols. 1-9, Hodgson, London, 1923-1929; see Vol. 1, pp. 245-259.
  • J.-M. De Koninck & A. Mercier, 1001 Problèmes en Théorie Classique des Nombres, Problem 241 pp. 39; 179, Ellipses Paris 2004.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Magma
    [a: n in [0..100] | IsPrime(a) where a is (3*n^2+3*n+1)]; // Vincenzo Librandi, Jan 20 2020
    
  • Mathematica
    lst={}; Do[If[PrimeQ[p=(n+1)^3-n^3], AppendTo[lst, p]], {n, 10^2}]; lst (* Vladimir Joseph Stephan Orlovsky, Aug 21 2008 *)
    Select[Table[3x^2+3x+1,{x,100}],PrimeQ] (* or *) Select[Last[#]- First[#]&/@ Partition[Range[100]^3,2,1],PrimeQ] (* Harvey P. Dale, Mar 10 2012 *)
    Select[Differences[Range[100]^3],PrimeQ] (* Harvey P. Dale, Jan 19 2020 *)
  • PARI
    {a(n)= local(m, c); if(n<1, 0, c=0; m=1; while( cMichael Somos, Sep 15 2005 */
    
  • PARI
    A002407(n,k=1)=until(isprime(3*k*k+++1) && !n--,);3*k*k--+1
    list_A2407(Nmax)=for(k=1,sqrt(Nmax/3),isprime(t=3*k*(k+1)+1) && print1(t",")) \\ M. F. Hasler, Nov 28 2007
    
  • Python
    from sympy import isprime
    def aupto(limit):
        alst, k, d = [], 1, 7
        while d <= limit:
            if isprime(d): alst.append(d)
            k += 1; d = 1+3*k*(k+1)
        return alst
    print(aupto(34000)) # Michael S. Branicky, Jul 19 2021

Formula

a(n) = 6*A000217(A111251(n)) + 1. - Christopher Hohl, Jul 01 2019
From Rémi Guillaume, Nov 07 2023: (Start)
a(n) = A003215(A111251(n)).
a(n) = (3*(2*A002504(n) - 1)^2 + 1)/4.
a(n) = (3*A121259(n)^2 + 1)/4.
a(n) = prime(A145203(n)). (End)

Extensions

More terms from James Sellers, Aug 08 2000
Entry revised by N. J. A. Sloane, Jan 29 2013

A358882 The number of regions in a Farey diagram of order (n,n).

Original entry on oeis.org

4, 56, 504, 2024, 8064, 18200, 50736, 99248, 202688, 343256, 657904, 983008, 1708672, 2485968, 3755184, 5289944, 8069736, 10539792, 15387320, 19913840
Offset: 1

Views

Author

Keywords

Comments

See A358298 and also the linked references for further details.
The first diagram where not all edge points are connected is n = 3. For example a line connecting points (0,1/3) and (1/3,0) has equation 3*y - 6*x - 1 = 0, and as one of the x or y coefficients is greater than n (3 in this case) the line is not included.

Crossrefs

Cf. A358883 (vertices), A358884 (edges), A358885 (k-gons), A006842, A006843, A005728, A358886.
See A358298 for definition of Farey diagram Farey(m,n).
The Farey Diagrams Farey(m,n) are studied in A358298-A358307 and A358882-A358885, the Completed Farey Diagrams of order (m,n) in A358886-A358889.

Formula

a(n) = A358884(n) - A358883(n) + 1 by Euler's formula.

A358885 Table read by rows: T(n,k) = the number of regions with k sides, k >= 3, in a Farey diagram of order (n,n).

Original entry on oeis.org

4, 48, 8, 400, 104, 1568, 456, 6216, 1848, 13944, 4256, 38760, 11976, 75768, 23480, 154440, 48248, 261072, 82184, 500464, 157440, 747480, 235528, 1298584, 410088, 1890184, 595784, 2853416, 901768, 4015552, 1274392, 6127632, 1942104, 8002552, 2537240, 11683880, 3703440, 15123800, 4790040
Offset: 1

Views

Author

Keywords

Comments

See the linked references for further details.
The first diagram where not all edge points are connected is n = 3. For example a line connecting points (0,1/3) and (1/3,0) has equation 3*y - 6*x - 1 = 0, and as one of the x or y coefficients is greater than n (3 in this case) the line is not included.
It would be nice to have a proof (or disproof) that the number of sides is always 3 or 4.

Examples

			The table begins:
4;
48, 8;
400, 104;
1568, 456;
6216, 1848;
13944, 4256;
38760, 11976;
75768, 23480;
154440, 48248;
261072, 82184;
500464, 157440;
747480, 235528;
1298584, 410088;
1890184, 595784;
2853416, 901768;
4015552, 1274392;
6127632, 1942104;
8002552, 2537240;
11683880, 3703440;
15123800, 4790040;
.
.
		

Crossrefs

Cf. A358882 (regions), A358883 (vertices), A358884 (edges), A006842, A006843, A005728, A358889.
See A358298 for definition of Farey diagram Farey(m,n).
The Farey Diagrams Farey(m,n) are studied in A358298-A358307 and A358882-A358885, the Completed Farey Diagrams of order (m,n) in A358886-A358889.

Formula

Sum of row n = A358882(n).

A358298 Array read by antidiagonals: T(n,k) (n>=0, k>=0) = number of lines defining the Farey diagram Farey(n,k) of order (n,k).

Original entry on oeis.org

2, 3, 3, 4, 6, 4, 6, 11, 11, 6, 8, 19, 20, 19, 8, 12, 29, 36, 36, 29, 12, 14, 43, 52, 60, 52, 43, 14, 20, 57, 78, 88, 88, 78, 57, 20, 24, 77, 100, 128, 124, 128, 100, 77, 24, 30, 97, 136, 162, 180, 180, 162, 136, 97, 30, 34, 121, 166, 216, 224, 252, 224, 216, 166, 121, 34
Offset: 0

Views

Author

Keywords

Comments

We work with lines with equation ux + vy + w = 0 in the (x,y) plane.
This line has slope -u/v, and crosses the vertical y axis at the intercept point y = -w/v
For the Farey diagram Farey(m,n), u is an integer between -(m-1) and +(m-1), v is between -(n-1) and +(n-1) and w can be any integer.
The only lines that are used are those that hit the unit square 0 <= x <= 1, 0 <= y <= 1 in at least two points.
This means that we only need to look at w's with |w| <= |u| + |v|.
T(m,n) is the number of such lines.
For illustrations of Farey(3,3) and Farey(3,4) see Khoshnoudirad (2015), Fig. 2, and Darat et al. (2009), Fig. 2. For further illustrations see A358882-A358885.

Examples

			The full array T(n,k), n >= 0, k>= 0, begins:
  2, 3, 4, 6, 8, 12, 14, 20, 24, 30, 34, 44, 48, 60,  ...
  3, 6, 11, 19, 29, 43, 57, 77, 97, 121, 145, 177, 205,  ...
  4, 11, 20, 36, 52, 78, 100, 136, 166, 210, 246, 302,  ...
  6, 19, 36, 60, 88, 128, 162, 216, 266, 326, 386, 468, ...
  8, 29, 52, 88, 124, 180, 224, 298, 360, 444, 518, 628, ...
  12, 43, 78, 128, 180, 252, 316, 412, 498, 608, 706,  ...
  14, 57, 100, 162, 224, 316, 388, 508, 608, 738, 852, ...
  ...
		

Crossrefs

Cf. A358299.
Row 0 is essentially A225531, row 1 is A358300, main diagonal is A358301.
The Farey Diagrams Farey(m,n) are studied in A358298-A358307 and A358882-A358885, the Completed Farey Diagrams of order (m,n) in A358886-A358889.

Programs

  • Maple
    A005728 := proc(n) 1+add(numtheory[phi](i), i=1..n) ; end proc: # called F_n in the paper
    Amn:=proc(m,n) local a,i,j;  # A331781 or equally A333295. Diagonal is A018805.
    a:=0; for i from 1 to m do for j from 1 to n do
    if igcd(i,j)=1 then a:=a+1; fi; od: od: a; end;
    # The present sequence is:
    Dmn:=proc(m,n) local d,t1,u,v,a; global A005728, Amn;
    a:=A005728(m)+A005728(n);
    t1:=0; for u from 1 to m do for v from 1 to n do
    d:=igcd(u,v); if d>=1 then t1:=t1 + (u+v)*numtheory[phi](d)/d; fi; od: od:
    a+2*t1-2*Amn(m,n); end;
    for m from 1 to 8 do lprint([seq(Dmn(m,n),n=1..20)]); od:
  • Mathematica
    A005728[n_] := 1 + Sum[EulerPhi[i], {i, 1, n}];
    Amn[m_, n_] := Module[{a, i, j}, a = 0; For[i = 1, i <= m, i++, For[j = 1, j <= n, j++, If[GCD[i, j] == 1, a = a + 1]]]; a];
    Dmn[m_, n_] := Module[{d, t1, u, v, a}, a = A005728[m] + A005728[n]; t1 = 0; For[u = 1, u <= m, u++, For[v = 1, v <= n, v++, d = GCD[u, v]; If[d >= 1 , t1 = t1 + (u + v)* EulerPhi[d]/d]]]; a + 2*t1 - 2*Amn[m, n]];
    Table[Dmn[m - n, n], {m, 0, 10}, {n, 0, m}] // Flatten (* Jean-François Alcover, Apr 03 2023, after Maple code *)

A176499 Haros-Farey sequence whose argument is the Fibonacci number; Farey(m) where m = Fibonacci(n + 1).

Original entry on oeis.org

2, 3, 5, 11, 23, 59, 141, 361, 941, 2457, 6331, 16619, 43359, 113159, 296385, 775897, 2030103, 5315385, 13912615, 36421835, 95355147, 249635525, 653525857, 1710966825, 4479358275, 11726974249, 30701593527, 80377757397, 210431301141, 550916379293
Offset: 1

Views

Author

Sameen Ahmed Khan, Apr 21 2010

Keywords

Comments

This sequence arises in the analytically obtained strict upper bound of the set of equivalent resistances formed by any conceivable network (series/parallel or bridge, or non-planar) of n equal resistors. Consequently it provides a strict upper bound of the sequences: A048211, A153588, A174283, A174284, A174285 and A174286. A176501 provides a better strict upper bound but is harder to compute. [Corrected by Antoine Mathys, May 07 2019]
Farey(n) = A005728(n). [Franklin T. Adams-Watters, May 12 2010]
The claim that this sequence is a strict upper bound for the number of representable resistance values of any conceivable network is wrong. It only applies to purely serial-parallel networks (A048211), but it already fails when bridges are allowed, as described in A174283. Even more so if arbitrary nonplanar networks are allowed as in A337517. See the linked illustrations of the respective quotients. - Hugo Pfoertner, Jan 24 2021

Examples

			n = 5, m = Fibonacci(5 + 1) = 8, Farey(8) = 23.
		

Crossrefs

Programs

  • GAP
    List([1..30],n->Sum([1..Fibonacci(n+1)],i->Phi(i)))+1; # Muniru A Asiru, Jul 31 2018
    
  • Magma
    [1+&+[EulerPhi(i):i in [1..Fibonacci(n+1)]]:n in [1..30]]; // Marius A. Burtea, Jul 26 2019
  • Maple
    with(numtheory): with(combinat,fibonacci): a:=n->1+add(phi(i),i=1..n): seq(a(fibonacci(n+1)),n=1..30); # Muniru A Asiru, Jul 31 2018
  • Mathematica
    b[n_] := 1 + Sum[EulerPhi[i], {i, 1, n}];
    a[n_] := b[Fibonacci[n + 1]];
    Array[a, 30] (* Jean-François Alcover, Sep 20 2018 *)
  • PARI
    farey(n) = 1+sum(k=1, n, eulerphi(k));
    a(n) = farey(fibonacci(n+1)); \\ Michel Marcus, Jul 31 2018
    

Formula

a(n) = A005728(A000045(n+1)). - Michel Marcus, Jul 31 2018

Extensions

a(26)-a(29) from Sameen Ahmed Khan, May 02 2010
a(30) from Antoine Mathys, Aug 06 2018

A176500 a(n) = 2*Farey(Fibonacci(n + 1)) - 3.

Original entry on oeis.org

1, 3, 7, 19, 43, 115, 279, 719, 1879, 4911, 12659, 33235, 86715, 226315, 592767, 1551791, 4060203, 10630767, 27825227, 72843667, 190710291, 499271047, 1307051711, 3421933647, 8958716547, 23453948495, 61403187051, 160755514791, 420862602279, 1101832758583
Offset: 1

Views

Author

Sameen Ahmed Khan, Apr 21 2010

Keywords

Comments

This sequence provides a strict upper bound of the set of equivalent resistances formed by any conceivable network (series/parallel or bridge, or non-planar) of n equal resistors. Consequently it provides an strict upper bound of the sequences: A048211, A153588, A174283, A174284, A174285 and A174286. A176502 provides a better strict upper bound but is harder to compute. [Corrected by Antoine Mathys, Jul 12 2019]
Farey(n) = A005728(n). - Franklin T. Adams-Watters, May 12 2010
The claim that this sequence is a strict upper bound for the number of representable resistance values of any conceivable network is incorrect for networks with more than 11 resistors, in which non-planar configurations can also occur. Whether the sequence provides at least a valid upper bound for planar networks with generalized bridge circuits (A337516) is difficult to decide on the basis of the insufficient number of terms in A174283 and A337516. See the linked illustrations of the respective quotients. - Hugo Pfoertner, Jan 24 2021

Examples

			n = 5, m = Fibonacci(5 + 1) = 8, Farey(8) = 23, 2Farey(m) - 3 = 43.
		

Crossrefs

Programs

  • Magma
    [2*(&+[EulerPhi(k):k in [1..Fibonacci(n+1)]])-1:n in [1..30]]; // Marius A. Burtea, Jul 26 2019
  • Mathematica
    a[n_] := 2 Sum[EulerPhi[k], {k, 1, Fibonacci[n+1]}] - 1;
    Table[an = a[n]; Print[an]; an, {n, 1, 30}] (* Jean-François Alcover, Nov 03 2018, from PARI *)
  • PARI
    a(n) = 2*sum(k=1,fibonacci(n+1),eulerphi(k))-1 \\ Charles R Greathouse IV, Oct 07 2016
    

Formula

a(n) = 2 * A176499(n) - 3.

Extensions

a(26)-a(28) from Sameen Ahmed Khan, May 02 2010
a(29)-a(30) from Antoine Mathys, Aug 06 2018
Previous Showing 21-30 of 106 results. Next