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: Joshua Harrington

Joshua Harrington's wiki page.

Joshua Harrington has authored 14 sequences. Here are the ten most recent ones:

A364237 a(n) is the number of non-equivalent permutations of {1,2,...,2n-1} such that no subset of consecutive terms from the permutation sums to 0 modulo 2n, where two permutations are equivalent if one can be obtained from the other by multiplying every entry with an integer relatively prime to 2n and/or reversing the permutation.

Original entry on oeis.org

1, 1, 2, 4, 42, 504, 7492, 172480, 8639632
Offset: 1

Keywords

Comments

If we consider all permutations of {1,2,...,2n-1} such that no subset of consecutive terms from the permutation sums to 0 modulo 2n, then the number of such permutations is given by the number of constructive orderings mentioned in A141599. For example, given the permutation 14325 that satisfies the given conditions, observe that the partial sums modulo 6, namely 1=1, 1+4=5, 1+4+3=2, 1+4+3+2=4, and 1+4+3+2+5=3, are distinct.

Examples

			When n=3, there are four permutations of {1,2,3,4,5} such that no subset of consecutive terms from the permutation sums to 0 modulo 6, namely 14325, 25314, 41352, and 52341. Note that 14325 and 52341 are equivalent by reversing the permutations. Furthermore multiplication by 5 on every entry also yields the same equivalence. Additionally, 25314 and 41352 are analogously equivalent. Hence a(3)=2.
When n=4, 6142573 and 3752416 are equivalent by reversing the permutations but not by multiplying any integer relatively prime to 8, whereas 6142573 and 2346751 are equivalent by multiplication of 3 on every entry.
		

Crossrefs

Cf. A141599.

Programs

  • SageMath
    n = 3 #the index for the sequence a(n)
    orbits = {} #dictionary of permutations that are consecutive zero-sum-free
    seen = [] #list of seen permutations that are consecutive zero-sum-free
    a = 0 #the value of a(n)
    for labeling in Permutations(range(1,2*n)):
        if labeling not in seen:
            sums = [labeling[0]]
            for i in range(1,2*n-1):
                nextsum = (labeling[i] + sums[i-1]) % (2*n)
                if any([nextsum == 0, nextsum in sums]):
                    break
                sums.append(nextsum)
            if len(sums) == (2*n)-1:
                a += 1
                orbits[a] = []
                for m in [x for x in range(1,2*n) if gcd(x,2*n) == 1]:
                    equiv = [(m*labeling[i]) % (2*n) for i in range(2*n-1)]
                    if equiv not in orbits[a]:
                        orbits[a].append(equiv)
                    seen.append(equiv)
                    equiv = [equiv[2*n-2-i] for i in range(2*n-1)]
                    if equiv not in orbits[a]:
                        orbits[a].append(equiv)
                    seen.append(equiv)
    print(f"a({n}) = {a}\n")
    print("Equivalencies:")
    for i in range(1,a+1):
        print(f"{i}.")
        for x in orbits[i]:
            print(x)
        print('\n')

Extensions

a(8)-a(9) from Sean A. Irvine, Aug 15 2023

A346563 a(n) = n + A007978(n).

Original entry on oeis.org

3, 5, 5, 7, 7, 10, 9, 11, 11, 13, 13, 17, 15, 17, 17, 19, 19, 22, 21, 23, 23, 25, 25, 29, 27, 29, 29, 31, 31, 34, 33, 35, 35, 37, 37, 41, 39, 41, 41, 43, 43, 46, 45, 47, 47, 49, 49, 53, 51, 53, 53, 55, 55, 58, 57, 59, 59, 61, 61, 67, 63, 65, 65, 67, 67
Offset: 1

Keywords

Comments

Beginning at n=3, a(n) represents the maximum length of consecutive numbers that are divisible by the product of their nonzero digits in base n. In particular, if n=10, the sequence of numbers that are divisible by the product of their nonzero digits is given by A055471.

Examples

			For n=6, the least non-divisor of 6 is 4, so a(6) = 6+4 = 10. As seen in the Comments section, 55980, 55981, ..., 55989 form a sequence of length 10, where every number is divisible by the product of its nonzero digits in base n=6. Work has been done to show that 10 is the maximum length for such sequences.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Module[{k = 1}, While[Divisible[n, k], k++]; n + k]; Array[a, 100] (* Amiram Eldar, Jul 23 2021 *)
  • PARI
    a(n) = my(k=2); while(!(n % k), k++); n+k; \\ Michel Marcus, Jul 23 2021
  • Python
    goal = 100
    these = []
    n = 1
    while n <= goal:
        k = 1
        while n % k == 0:
            k = k + 1
        these.append(n + k)
        n += 1
    print(these)
    

Formula

a(2k+1) = 2k+3.
a(2k) >= 2k+3.

A346537 Squares that are divisible by the product of their nonzero digits.

Original entry on oeis.org

1, 4, 9, 36, 100, 144, 400, 900, 1024, 1296, 2304, 2500, 2916, 3600, 10000, 11664, 12100, 14400, 22500, 32400, 40000, 41616, 78400, 82944, 90000, 102400, 110224, 121104, 122500, 129600, 152100, 176400, 186624, 200704, 202500, 219024, 230400, 250000, 260100, 291600
Offset: 1

Keywords

Examples

			For the perfect square 1024 = 32^2 the product of its nonzero digits is 8 which divides 1024.
		

Crossrefs

Intersection of A000290 and A055471.

Programs

  • Mathematica
    Select[Range[500]^2, Divisible[#, Times @@ Select[IntegerDigits[#], #1 > 0 &]] &] (* Amiram Eldar, Jul 23 2021 *)
  • PARI
    isok(m) = issquare(m) && !(m % vecprod(select(x->(x>0), digits(m))));
    lista(nn) = for (m=1, nn, if (isok(m^2), print1(m^2, ", "))); \\ Michel Marcus, Jul 23 2021
  • Python
    from math import prod
    def nzpd(n): return prod([int(d) for d in str(n) if d != '0'])
    def ok(sqr): return sqr > 0 and sqr%nzpd(sqr) == 0
    print(list(filter(ok, (i*i for i in range(541))))) # Michael S. Branicky, Jul 23 2021
    

A339999 Squares that are divisible by both the sum of their digits and the product of their nonzero digits.

Original entry on oeis.org

1, 4, 9, 36, 100, 144, 400, 900, 1296, 2304, 2916, 3600, 10000, 11664, 12100, 14400, 22500, 32400, 40000, 41616, 82944, 90000, 121104, 122500, 129600, 152100, 176400, 186624, 202500, 219024, 230400, 260100, 291600, 360000, 419904, 435600, 504100
Offset: 1

Keywords

Examples

			For the perfect square 144 = 12^2, the sum of its digits is 9, which divides 144, and the product of its nonzero digits is 16, which also divides 144 so 144 is a term of the sequence.
		

Crossrefs

Intersection of A000290, A005349 and A055471.

Programs

  • Mathematica
    Select[Range[720]^2, And @@ Divisible[#, {Plus @@ (d = IntegerDigits[#]), Times @@ Select[d, #1 > 0 &]}] &] (* Amiram Eldar, Jul 23 2021 *)
  • Python
    from math import prod
    def sumd(n): return sum(map(int, str(n)))
    def nzpd(n): return prod([int(d) for d in str(n) if d != '0'])
    def ok(sqr): return sqr > 0 and sqr%sumd(sqr) == 0 and sqr%nzpd(sqr) == 0
    print(list(filter(ok, (i*i for i in range(1001)))))
    # Michael S. Branicky, Jul 23 2021

A346657 Numbers that are not divisible by the product of their nonzero digits.

Original entry on oeis.org

13, 14, 16, 17, 18, 19, 21, 22, 23, 25, 26, 27, 28, 29, 31, 32, 33, 34, 35, 37, 38, 39, 41, 42, 43, 44, 45, 46, 47, 48, 49, 51, 52, 53, 54, 55, 56, 57, 58, 59, 61, 62, 63, 64, 65, 66, 67, 68, 69, 71, 72, 73, 74, 75, 76, 77, 78, 79, 81, 82, 83, 84, 85, 86, 87
Offset: 1

Keywords

Examples

			The product of the nonzero digits of 42 is 4*2 = 8, which does not divide 42.
		

Crossrefs

Complement of A055471.

Programs

  • Mathematica
    Select[Range[100], !Divisible[#, Times @@ Select[IntegerDigits[#], #1 > 0 &]] &] (* Amiram Eldar, Jul 27 2021 *)
  • PARI
    isok(k) = k % vecprod(select(x->(x>0), digits(k))); \\ Michel Marcus, Jul 28 2021
  • Python
    from math import prod
    def ok(n): return n > 0 and n%prod([int(d) for d in str(n) if d != '0'])
    print(list(filter(ok, range(88)))) # Michael S. Branicky, Jul 27 2021
    

A317244 For n >= 3, smallest prime number N such that for every prime p >= N, every element in Z_p can be expressed as a sum of two n-gonal numbers mod p, without allowing zero as a summand.

Original entry on oeis.org

11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 13, 11, 11, 11, 11, 11, 11, 11, 23, 11, 11, 13, 29, 11, 11, 11, 11, 11, 11, 11, 37, 11, 13, 11, 11, 11, 11, 23, 11, 11, 11, 11, 47, 13, 11, 29, 53, 11, 11, 11, 11, 11, 11, 11, 13, 11, 23, 11, 61, 11, 11, 37, 11, 11, 11, 13, 71, 11, 29, 11, 73, 11, 11, 11, 11, 23, 13, 11, 83, 11, 11, 11, 89, 11, 11, 47, 11, 13, 11, 11, 11, 29, 37, 53, 23, 11
Offset: 3

Keywords

A317254 a(n) is the smallest integer such that for all s >= a(n), there are at least n-1 different partitions of s into n parts, namely {x_{11},x_{12},...,x_{1n}}, {x_{21},x_{22},...,x_{2n}},..., and {x_{n-1,1},x_{n-1,2},...,x_{n-1,n}}, such that the products of every set are equal.

Original entry on oeis.org

19, 23, 23, 26, 27, 29, 31, 32, 35, 36, 38, 40, 42, 44, 45, 47, 49, 50, 52, 53, 54, 55, 57, 58, 59, 61, 62, 63, 64, 66, 67, 69, 70, 71, 73, 74, 75, 77, 78, 80, 81, 82, 84, 85, 86, 87, 88, 89, 90, 91, 93, 94, 95, 96, 97, 99, 100, 101
Offset: 3

Keywords

Examples

			a(3)=19. From s=19 onward, there are at least 2 different partitions of s into 3 parts with equal products:
s=19: {12,4,3} & {9,8,2}:
  12 + 4 + 3 = 9 + 8 + 2 =  19;
  12 * 4 * 3 = 9 * 8 * 2 = 144;
s=20: {15,3,2} & {10,9,1}:
  15 + 3 + 2 = 10 + 9 + 1 = 20;
  15 * 3 * 2 = 10 * 9 * 1 = 90;
s=21: {16,3,2} & {12,8,1}:
  16 + 3 + 2 = 12 + 8 + 1 = 21;
  16 * 3 * 2 = 12 * 8 * 1 = 96.
		

Crossrefs

Programs

  • Mathematica
    Do[maxsumnotwork = 0;  Do[intpart = IntegerPartitions[sum, {n}];   prod = Table[Times @@ intpart[[i]], {i, Length[intpart]}];   prodtally = Tally[prod];   repeatprod = Select[prodtally, #[[2]] >= n - 1 &];   If[repeatprod == {}, maxsumnotwork = sum], {sum, 12, 200}];  Print[n, " ", maxsumnotwork + 1], {n, 3, 60}]

A316945 A triple of positive integers (n,p,k) is admissible if there exist at least two different multisets of k positive integers, {x_1,x_2,...,x_k} and {y_1,y_2,...,y_k}, such that x_1+x_2+...+x_k=y_1+y_2+...+y_k = n and x_1x_2...x_k = y_1y_2...y_k = p. For each n, let A(n)={k:(n,p,k) is admissible for some p}, and let a(n) = |A(n)|.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 4, 4, 6, 7, 7, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74
Offset: 1

Keywords

Comments

John Conway proposed an interesting math puzzle in the 1960s, which is now generally known as "Conway's wizard problem." Here is the problem.
Last night I sat behind two wizards on a bus and overheard the following:
Blue Wizard: I have a positive integer number of children, whose ages are positive integers. The sum of their ages is the number of this bus, while the product is my own age.
Red Wizard: How interesting! Perhaps if you told me your age and the number of your children, I could work out their individual ages?
Blue Wizard: No, you could not.
Red Wizard: Aha! At last, I know how old you are!
Apparently the Red Wizard had been trying to determine the Blue Wizard's age for some time. Now, what was the number of the bus?
This problem posed by Conway looks at different multisets that correspond to the same ordered triple, which motivated the study of this sequence.

Examples

			For n = 3, the only partitions of 3 are {3}, {1,2}, and {1,1,1}. Hence, there is no admissible triple (3,p,k).
For n = 4, the only partitions of 4 are {4}, {1,3}, {2,2},{1,1,2}, and {1,1,1,1}. Hence, there is no admissible triple (4,p,k).
For n = 12, the only admissible triple (12,p,k) is when p = 48 and k = 4. This is achieved by the following multisets: {1,3,4,4} and {2,2,2,6}. Thus a(12) = 1.
		

Crossrefs

Programs

  • Mathematica
    Table[Count[
      Table[intpart = IntegerPartitions[sum, {n}];
       DuplicateFreeQ[
        Table[Product[intpart[[i]][[j]], {j, n}], {i,
          Length[intpart]}]], {n, sum}], False], {sum,50}]

Formula

a(n) = 0 for 1 <= n <= 11, a(12) = 1, a(13) = 2, a(14) = 4, a(15) = 4, a(16) = 6, a(17) = 7, a(18) = 7, and a(n) = n - 10 for n >= 19.

A316946 A triple of positive integers (n,p,k) is admissible if there exist at least two different multisets of k positive integers, {x_1,x_2,...,x_k} and {y_1,y_2,...,y_k}, such that x_1+x_2+...+x_k = y_1+y_2+...+y_k = n and x_1x_2...x_k = y_1y_2...y_k = p. For each n, let A(n) = {p:(n,p,k) is admissible for some k}, and let a(n) = |A(n)|.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 5, 6, 10, 14, 19, 26, 33, 43, 54, 68, 87, 106, 129, 157, 187, 226, 269, 319, 378, 445, 521, 610, 712, 825, 952, 1099, 1261, 1443, 1655, 1889, 2148, 2440, 2769, 3135, 3542, 4000, 4494, 5049, 5661, 6346, 7099, 7938, 8857, 9862, 10972, 12190, 13532, 15000, 16611, 18366
Offset: 1

Keywords

Comments

John Conway proposed an interesting math puzzle in the 1960s, which is now generally known as the "Conway's wizard problem." Here is the problem.
Last night I sat behind two wizards on a bus and overheard the following:
Blue Wizard: I have a positive integer number of children, whose ages are positive integers. The sum of their ages is the number of this bus, while the product is my own age.
Red Wizard: How interesting! Perhaps if you told me your age and the number of your children, I could work out their individual ages?
Blue Wizard: No, you could not.
Red Wizard: Aha! At last, I know how old you are!
Apparently the Red Wizard had been trying to determine the Blue Wizard's age for some time. Now, what was the number of the bus?
This problem posed by Conway looks at different multisets that correspond to the same ordered triple, which motivated the study of this sequence.

Examples

			a(15) = 6 since A(15) = {36,40,48,72,96,144}:
p = 36 [9, 2, 2, 1, 1], [6, 6, 1, 1, 1]
p = 40 [10, 2, 2, 1], [8, 5, 1, 1]
p = 48 [6, 2, 2, 2, 1, 1, 1], [4, 4, 3, 1, 1, 1, 1]
p = 72 [9, 2, 2, 2], [8, 3, 3, 1], [6, 6, 2, 1],
p = 96 [8, 3, 2, 2], [6, 4, 4, 1], [6, 2, 2, 2, 2, 1], [4, 4, 3, 2, 1, 1]
p = 144 [6, 3, 2, 2, 2], [4, 4, 3, 3, 1].
		

Crossrefs

Programs

  • Mathematica
    Do[repeats = {};  Do[intpart = IntegerPartitions[sum, {n}];   prod = Tally[Table[Times @@ intpart[[i]], {i, Length[intpart]}]];   repeatprod = Select[prod, #[[2]] > 1 &];   If[repeatprod != {},    repeats = Join[repeats, Transpose[repeatprod][[1]]]], {n, 3,    sum - 8}]; output = DeleteDuplicates[repeats];  Print[sum, " ", Length[output]], {sum, 12, 100}]

A290322 Sum modulo n of all units u in Z/nZ such that Phi(5,u) is a unit, where Phi is the cyclotomic polynomial.

Original entry on oeis.org

1, 0, 0, 4, 0, 0, 0, 0, 9, 1, 0, 0, 0, 3, 0, 0, 0, 0, 8, 0, 12, 0, 0, 20, 0, 0, 0, 0, 18, 1, 0, 24, 0, 14, 0, 0, 0, 0, 16, 1, 0, 0, 24, 9, 0, 0, 0, 0, 45, 0, 0, 0, 0, 14, 0, 0, 0, 0, 36, 1, 32, 0, 0, 13, 24, 0, 0, 0, 14, 1, 0, 0, 0, 15, 0, 28, 0, 0, 32, 0, 42, 0
Offset: 2

Keywords

Comments

Conjecture: If n is divisible by 5 then a(n) > 0. - Robert Israel, Jan 23 2024

Crossrefs

Programs

  • Maple
    with(numtheory): m:=5: for n from 2 to 100 do S:={}: for a from 1 to n-1 do if gcd(a,n)=1 and gcd(cyclotomic(m,a),n)=1 then S:={op(S),a}: fi: od: print(sum(op(i,S),i=1..nops(S)) mod n): od:
  • Mathematica
    Table[Mod[Total@ Select[Range[n - 1], CoprimeQ[#, n] && CoprimeQ[Cyclotomic[5, #], n] &], n], {n, 83}] (* Michael De Vlieger, Jul 29 2017 *)
  • PARI
    a(n) = sum(k=0, n-1, k*((gcd(n, k)==1) && (gcd(n, polcyclo(5, k))==1))) % n; \\ Michel Marcus, Jul 29 2017