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.

User: Ken Levasseur

Ken Levasseur's wiki page.

Ken Levasseur has authored 4 sequences.

A238729 Maximum flow of a number.

Original entry on oeis.org

2, 3, 2, 5, 4, 7, 2, 3, 4, 11, 4, 13, 4, 6, 2, 17, 5, 19, 4, 6, 4, 23, 4, 5, 4, 3, 4, 29, 8, 31, 2, 6, 4, 10, 5, 37, 4, 6, 4, 41, 8, 43, 4, 6, 4, 47, 4, 7, 6, 6, 4, 53, 5, 10, 4, 6, 4, 59, 8, 61, 4, 6, 2, 10, 8, 67, 4, 6, 8, 71, 5, 73, 4, 8, 4, 14, 8, 79, 4, 3
Offset: 2

Author

Ken Levasseur, Mar 03 2014

Keywords

Comments

F(n) is the maximal flow in a network whose nodes are the divisors of n, with an edge from a to b if and only if b/a is a prime factor of n, in which case the capacity of the edge is b/a. The source of the network is 1 and the sink is n.

Programs

  • Maple
    with(combinat):
    a:= proc(n) local S, s, f, l, m;
          f:= infinity; l:= ifactors(n)[2]; m:= nops(l);
          S:= subsets({$1..m}):
          while not S[finished] do s:= S[nextvalue]();
            if s={} then next fi:
            f:= min(f, mul(1+l[i][2], i=({$1..m} minus s))*add(l[i][1], i=s))
          od; f
        end:
    seq(a(n), n=2..100);  # Alois P. Heinz, Mar 04 2014
  • Mathematica
    F[n_] := F[n] = Module[{v, e, flowgraph, flow},
       v = Divisors[n];
       e = Apply[DirectedEdge,
         Select[Subsets[v, {2}], PrimeQ[Last[#]/First[#]] &], {1}];
       flowgraph =
        Graph[e, EdgeCapacity -> Map[Rule[#, (Divide @@ Reverse[#])] &, e]];
       flow = FindMaximumFlow[flowgraph, 1, n, "OptimumFlowData"];
       flow["FlowValue"]]

Formula

a(n) = min_{S:P([m])\{}} Product_{i:[m]\S} (e_i+1) * Sum_{i:S} p_i, where n = Product_{i=1..m} p_i^e_i and P([m]) is the powerset of {1,...,m}.

A145021 a(n) = number of different positive integers that can be formed from different groupings of expressions of the form n op1 n op2 n op3 n, where each of op1, op2 and op3 are addition, subtraction, multiplication or division.

Original entry on oeis.org

4, 10, 20, 25, 27, 29, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30
Offset: 1

Author

Ken Levasseur, Sep 29 2008

Keywords

Comments

If one uses all 4^3=64 forms of this type but no parentheses, the sequence starts 4,9,15,13,15,14... In this case 4/4/4/4=1/4/4=1/16 is not an integer (association left-to-right), whereas with parenthesis one could write (4/4)/(4/4)=1, an integer, for example. The definition need clarification in this respect. [From R. J. Mathar, Jan 22 2009]

Examples

			You can form the numbers 1, 2, 3, 4 with 4 ones; hence the first term is 4.
		

Formula

If k >3, a(2k-1)=30 and a(2k)=31. - Ken Levasseur, Oct 01 2008

A054736 Smallest losing position after your opponent has taken k stones in a variation of "Fibonacci Nim".

Original entry on oeis.org

4, 8, 11, 15, 21, 29, 40, 55, 76, 105, 145, 200, 276, 381, 526, 726, 1002, 1383, 1909, 2635, 3637, 5020, 6929, 9564, 13201, 18221, 25150, 34714, 47915, 66136, 91286, 126000, 173915, 240051, 331337, 457337, 631252, 871303, 1202640, 1659977, 2291229, 3162532, 4365172
Offset: 1

Author

Ken Levasseur, Apr 22 2000

Keywords

Comments

In Fibonacci Nim, the first player takes any number of stones (except all) and then each player takes no more than twice the number taken in the previous move. This sequence concerns the game where 2 is replaced by 3.

Examples

			If your opponent has just removed 1 or 2 stones from the pile leaving you with 8, then you lose. Any fewer stones after your opponent has taken 2 will be a win for you.
		

References

  • R. K. Guy, Fair Game: How to play impartial combinatorial games, COMAP's Mathematical Exploration Series, 1989; see p. 22.

Programs

  • Python
    MAXTERM=10**9
    cache, oldk = [MAXTERM], 1
    for nleft in range(1,MAXTERM+1):
      for k in range(1,nleft+1):
        if koldk:
        print(nleft)
        oldk=mk
    # Bert Dobbelaere, Apr 07 2024

Extensions

More terms from Bert Dobbelaere, Apr 07 2024

A008837 a(n) = p*(p-1)/2 for p = prime(n).

Original entry on oeis.org

1, 3, 10, 21, 55, 78, 136, 171, 253, 406, 465, 666, 820, 903, 1081, 1378, 1711, 1830, 2211, 2485, 2628, 3081, 3403, 3916, 4656, 5050, 5253, 5671, 5886, 6328, 8001, 8515, 9316, 9591, 11026, 11325, 12246, 13203, 13861, 14878, 15931, 16290, 18145, 18528, 19306
Offset: 1

Keywords

Comments

Whereas A034953 is the sequence of triangular numbers with prime indices, this is the sequence of triangular numbers with numbers one less than primes for indices. - Alonso del Arte, Aug 17 2014
From Jianing Song, Apr 13 2019: (Start)
a(n) is both the number of quadratic residues and the number of nonresidues modulo prime(n)^2 that are coprime to prime(n).
For k coprime to prime(n), k^a(n) == +-1 (mod prime(n)^2). (End)

Crossrefs

Half the terms of A036689.
Cf. A000217 (triangular numbers), A112456 (least triangular number divisible by n-th prime). - Klaus Brockhaus, Nov 18 2008
Column 1 of A257253. (Row 1 of A257254).

Programs

Formula

a(n) = binomial(prime(n), 2) = A000217(A000040(n)-1). - Enrique Pérez Herrero, Dec 10 2011
a(n) = (1/2)*A072230(A000040(n)). - L. Edson Jeffery, Apr 07 2012
a(n) = (phi(prime(n))^2 + phi(prime(n)))/2, where phi(n) is Euler's totient function, A000010. - Alonso del Arte, Aug 22 2014
a(n) = A036689(n)/2. - Antti Karttunen, May 01 2015
Product_{n>=2} (1 - 1/a(n)) = A271780. - Amiram Eldar, Nov 22 2022

Extensions

Offset changed from 2 to 1 by Harry J. Smith, Jul 25 2009