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: Arnauld Chevallier

Arnauld Chevallier's wiki page.

Arnauld Chevallier has authored 8 sequences.

A367680 Number of integer compositions x1+x2+...+xk of n such that each xj has exactly j bits set.

Original entry on oeis.org

1, 1, 1, 0, 2, 1, 1, 3, 2, 1, 2, 4, 2, 4, 6, 2, 4, 5, 10, 7, 10, 12, 8, 6, 11, 14, 16, 13, 16, 16, 14, 14, 30, 32, 19, 35, 28, 23, 27, 38, 36, 47, 44, 42, 55, 52, 51, 85, 88, 74, 84, 84, 72, 81, 102, 110, 122, 115, 108, 132, 137, 136, 179, 195, 164, 160, 181
Offset: 0

Author

Arnauld Chevallier, Nov 26 2023

Keywords

Examples

			There are 6 such compositions for n = 14:
  14 = 1 + 6 + 7 (1 + 110 + 111)
  14 = 2 + 5 + 7 (10 + 101 + 111)
  14 = 2 + 12 (10 + 1100)
  14 = 4 + 3 + 7 (100 + 11 + 111)
  14 = 4 + 10 (100 + 1010)
  14 = 8 + 6 (1000 + 110)
Therefore a(14) = 6.
		

Programs

  • PARI
    a(n) = my(nb=0); forpart(v=n, if (vecsort(apply(hammingweight, Vec(v))) == [1..#v], nb++)); nb; \\ Michel Marcus, Nov 28 2023

A338546 For n > 0, a(n) is the number of 1's among the first T(n) terms of the sequence 1, 0, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, ..., k 1's, k 0's, where T(n) is the n-th triangular number.

Original entry on oeis.org

1, 2, 3, 6, 9, 11, 15, 21, 24, 28, 36, 42, 46, 55, 65, 70, 78, 91, 99, 105, 120, 133, 140, 153, 171, 180, 190, 210, 225, 234, 253, 275, 285, 300, 325, 341, 352, 378, 402, 414, 435, 465, 481, 496, 528, 553, 567, 595, 630, 645, 666, 703, 728, 744, 780, 816
Offset: 1

Author

Arnauld Chevallier, Nov 02 2020

Keywords

Comments

The sequence of 1's and 0's is more formally defined as A118175.

Examples

			Equivalently, this is the number of 1's up to the n-th row of a triangle filled with A118175:
   1 (1)
   01 (2)
   100 (3)
   1110 (6)
   00111 (9)
   100001 (11)
   1111000 (15)
   00111111 (21)
   000000111 (24)
   1111000000 (28)
   01111111100 (36)
   000000111111 (42)
   ...
		

Crossrefs

Based on A118175 and A000217.

Programs

  • Mathematica
    With[{nn = 56}, Accumulate@ Map[Total, TakeList[Array[1 - Ceiling[#] + Round[#] &@ Sqrt[#] &, PolygonalNumber[nn]], Range[nn]]]] (* Michael De Vlieger, Nov 02 2020, after Branko Curgus at A118175 *)
  • PARI
    f(n) = my(r=sqrt(n)); 1 - ceil(r) + round(r);
    a(n) = sum(k=1, n*(n+1)/2, f(k)==1); \\ Michel Marcus, Nov 12 2020

A334398 Number of endless self-avoiding walks of length n for the square lattice up to rotation, reflection, and path reversal.

Original entry on oeis.org

1, 2, 3, 7, 16, 39, 96, 245, 631, 1642
Offset: 1

Author

Peter Kagey and Arnauld Chevallier, Apr 26 2020

Keywords

Comments

a(n) > A334322(n)/16.

Examples

			The a(4) = 7 step patterns of length 4 are
---->---->---->---->, ---->---->---->, ---->---->     ,
                                    |           |
                                    v           v---->
---->---->, ---->    ^, ---->     , and ---->     .
         |      |    |      |               |
         v      v---->      v---->          v
         |                       |          |
         v                       v          v---->
		

Crossrefs

Cf. A334322.

A332046 a(n) is the smallest positive integer such that there exist exactly n positive integers less than a(n) whose digital sum in base 10 is equal to the digital sum of a(n).

Original entry on oeis.org

10, 20, 30, 40, 50, 60, 70, 80, 90, 108, 117, 126, 135, 144, 153, 162, 171, 180, 207, 216, 225, 234, 243, 252, 261, 270, 280, 307, 316, 325, 334, 343, 352, 361, 370, 406, 415, 424, 433, 442, 451, 460, 470, 506, 515, 524, 533, 542, 551, 560, 605, 614, 623, 632, 641, 650, 660
Offset: 1

Author

Arnauld Chevallier, Feb 06 2020

Keywords

Examples

			For n=10, 108 is the smallest positive integer for which there exists exactly 10 smaller integers whose digit sum in base 10 is the same as the digit sum of 108 (i.e., 1+0+8=9). These integers are 9, 18, 27, 36, 45, 54, 63, 72, 81, 90.
		

Crossrefs

Cf. A081926 (similar but different definition).

Programs

  • PARI
    isok(k, n) = {my(v=vector(k, j, sumdigits(j))); #select(x->(x==v[k]), v) == n+1;}
    a(n) = {my(k=1); while(! isok(k, n), k++); k;} \\ Michel Marcus, Feb 16 2020

A316976 Numbers k such that some of the values (r0-r1+k) mod k for all pairs (r0,r1) of quadratic residues mod k are unique.

Original entry on oeis.org

1, 3, 4, 5, 8, 9, 12, 15, 16, 20, 24, 32, 36, 40, 45, 48, 60, 64, 72, 80, 96, 120, 128, 144, 160, 180, 192, 240, 288, 320, 360, 384, 480, 576, 640, 720, 960, 1152, 1440, 1920, 2880, 5760
Offset: 1

Author

Arnauld Chevallier, Jul 17 2018

Keywords

Comments

These are the numbers k such that A316975(k) = 1.
It is conjectured that this list is finite and limited to the terms given in the DATA section.
All known terms are 5-smooth.

Examples

			The quadratic residues mod 12 are 0, 1, 4 and 9. For each pair (r0,r1) of these quadratic residues, we compute (r0-r1+12) mod 12, leading to:
       0  1  4  9
    +------------
  0 |  0 11  8  3
  1 |  1  0  9  4
  4 |  4  3  0  7
  9 |  9  8  5  0
The values 1, 5, 7 and 11 are unique in the above table. Therefore 12 belongs to the list.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[10^3], Function[{n}, Min@ Tally[#][[All, -1]] == 1 &@ Flatten[Mod[#, n] & /@ Outer[Subtract, #, #]] &@ Union@ PowerMod[Range@ n, 2, n]]] (* Michael De Vlieger, Jul 20 2018 *)

A316975 a(n) is the minimum number of occurrences of the same value (r0-r1+n) mod n for all pairs (r0,r1) of quadratic residues mod n.

Original entry on oeis.org

1, 2, 1, 1, 1, 2, 2, 1, 1, 2, 3, 1, 3, 4, 1, 1, 4, 2, 5, 1, 2, 6, 6, 1, 2, 6, 2, 2, 7, 2, 8, 1, 3, 8, 2, 1, 9, 10, 3, 1, 10, 4, 11, 3, 1, 12, 12, 1, 8, 4, 4, 3, 13, 4, 3, 2, 5, 14, 15, 1, 15, 16, 2, 1, 3, 6, 17, 4, 6, 4, 18, 1, 18, 18, 2, 5, 6, 6, 20, 1, 4, 20
Offset: 1

Author

Arnauld Chevallier, Jul 17 2018

Keywords

Comments

Multiplicative by the Chinese remainder theorem since if gcd(m,n) = 1 then r is a quadratic residue mod m*n iff it is a quadratic residue mod m and a quadratic residue mod n. - Andrew Howroyd, Aug 07 2018

Examples

			The quadratic residues mod 10 are 0, 1, 4, 5, 6 and 9. For each pair (r0,r1) of these quadratic residues, we compute (r0-r1+10) mod 10, leading to:
      0 1 4 5 6 9
    +------------
  0 | 0 9 6 5 4 1
  1 | 1 0 7 6 5 2
  4 | 4 3 0 9 8 5
  5 | 5 4 1 0 9 6
  6 | 6 5 2 1 0 7
  9 | 9 8 5 4 3 0
The minimum number of occurrences of the same value in the above table is 2 (for 2, 3, 7 and 8). Therefore a(10) = 2.
		

Crossrefs

Cf. A096008.

Programs

  • Mathematica
    Table[Min@ Tally[#][[All, -1]] &@ Flatten[Mod[#, n] & /@ Outer[Subtract, #, #]] &@ Union@ PowerMod[Range@ n, 2, n], {n, 82}] (* Michael De Vlieger, Jul 20 2018 *)
  • PARI
    a(n)={my(r=Set(vector(n,i,i^2%n))); my(v=vector(n)); for(i=1, #r, for(j=1, #r, v[(r[i]-r[j])%n + 1]++)); vecmin(select(t->t>0, v))} \\ Andrew Howroyd, Aug 07 2018

A316780 a(n) is the least positive integer k such that ceiling(sqrt(A046315(n)*k))^2 - A046315(n)*k is a square.

Original entry on oeis.org

1, 1, 1, 1, 3, 1, 3, 1, 3, 1, 3, 1, 5, 1, 3, 7, 1, 7, 3, 9, 3, 3, 1, 9, 9, 3, 11, 1, 5, 5, 13, 3, 1, 15, 15, 5, 1, 17, 3, 5, 1, 17, 7, 3, 17, 1, 7, 19, 1, 21, 3, 5, 7, 23, 5, 1, 25, 9, 1, 5, 25, 9, 27, 3, 27, 1, 29, 5, 11, 29, 3, 11, 1, 11, 5, 3, 33, 1, 35, 13
Offset: 1

Author

Arnauld Chevallier, Jul 13 2018

Keywords

Comments

Fermat's factorization helper multiplier for the n-th odd semiprime.
a(n) is the least positive integer such that A046315(n) * a(n) can be factorized with a single iteration of Fermat's factorization method. Using the factorization of a(n), we can then deduce the prime factors of A046315(n). Example for n = 35490: A046315(n) = 199163 and a(n) = 40; ceiling(sqrt(199163*40)) = 2823; 199163*40 = 2823^2 - 2809 = 2823^2 - 53^2 = (2823+53)(2823-53) = 2876*2770, leading to 199163*(2*2*2*5) = (2*2*719)*(2*5*277) and eventually 199163 = 719*277.

Examples

			a(18) = 7 because the 18th odd semiprime is A046315(18) = 93, ceiling(sqrt(93*7))^2 - 93*7 = 25 is a perfect square and 7 is the least positive integer for which this holds.
		

Crossrefs

Cf. A046315.

A316776 a(n) is the number of integers 0 < k < n such that n^2 - k^2 is a semiprime.

Original entry on oeis.org

0, 0, 0, 1, 2, 1, 1, 3, 2, 2, 3, 3, 3, 2, 3, 2, 4, 5, 1, 4, 4, 3, 3, 5, 5, 4, 5, 4, 4, 6, 2, 5, 7, 2, 6, 6, 4, 5, 8, 4, 4, 8, 5, 5, 9, 5, 5, 8, 3, 6, 8, 5, 5, 8, 6, 8, 10, 7, 5, 13, 4, 6, 10, 3, 8, 9, 6, 5, 8, 7, 8, 12, 6, 5, 12, 4, 8, 12, 4, 9, 11, 5, 5, 13, 10, 6, 11, 7, 7, 14, 6, 9, 14, 6, 8, 11
Offset: 1

Author

Arnauld Chevallier, Jul 12 2018

Keywords

Examples

			a(11) = 3 because 11^2 - 6^2 = 85, 11^2 - 8^2 = 57 and 11^2 - 10^2 = 21 are the only three semiprimes of the form 11^2 - k^2 with 0 < k < 11.
		

Crossrefs

Cf. A001358.

Programs

  • Mathematica
    a[n_] := Sum[Boole[ PrimeOmega[n^2 - k^2] == 2], {k, n-1}]; Array[a, 96] (* Giovanni Resta, Jul 13 2018 *)
  • PARI
    a(n) = sum(k=1, n-1, bigomega(n^2-k^2)==2); \\ Michel Marcus, Jul 12 2018