OEIS A330170

by Michael Thomas De Vlieger, St. Louis, Missouri, 2020 0730.

Introduction.

Consider a(n) = A330170(n) = 2n + 3n + 6n − 1. For every prime p, there exists n ≥ 1 such that p divides a(n). Further, for every prime p, p | a(n) for n ≡ −1 (mod p − 1), as a consequence of Fermat’s Little Theorem.

All terms of a(n) are even, since we have as addends three perfect powers, two odd, one even, and we offset by 1.

The sequence is a linear recurrence (12,−47,72,−36), with generating function 2x(5 − 36x + 72x² − 36x³) / ((1 − x)(1 − 2x)(1 − 3x)(1 − 6x)), starting {10, 48, 250, 1392, 8050, 47448, 282250, 1686432, …}. See Codes 1.1, 1.2, and 1.3 to generate a(n).

We examine residues n (mod p – 1) such that p | a(n), knowing that we have p | a(n) for n ≡ −1 (mod p − 1).

We know that for n ≡ 0 (mod 1), 2 | a(n), i.e., all terms of a(n) are even.
For n ≡ 0 (mod 2), 3 | a(n), i.e., all terms a(k) are divisible by 3 for even k.
For n ≡ ±1 (mod 4), 5 | a(n), i.e., all terms a(k) are divisible by 5 for odd k.
For n ≡ −1 (mod 6), 7 | a(n), e.g., 7 | a(5) = 8050 = 2 × 5² × 7 × 23, 7 | a(11) = 2 × 54 × 7 × 13 × 3191, etc.
For n ≡ −2 or −1 (mod 10), 11 | a(n), 11 | a(8) = 1686432, 11 | a(9) = 10097890, etc.

For n ≡ {5, 10, −6, −1} (mod 22), 23 | a(n); 23 | a(5) = 8050 = 2 × 5² × 7 × 23, …
For n ≡ {12, 25, 36, 47, −36, −23, −12, −1} (mod 96), 97 | a(n), e.g., 97 | a(12) = 24 × 3² × 97² × 1607.

Sequence b(n): number of residues r such that p | a(n) for nr (mod p − 1).

Therefore we observe, that though p | a(n) for n ≡ −1 (mod p − 1), for certain primes we have additional residues r (mod p − 1) that have a(r) divisible by p. We might write a sequence b(n) = number of residues r such that p | A330170(n) with n r (mod p − 1) (see code 2.1). The first terms are:

1, 1, 2, 1, 2, 1, 1, 2, 4, 4, 1, 1, 2, 2, 2, 2, 2, 1, 2, 2, 2, 1, 1, 1, 8, 4, 1, ...

Sequence c(n): Position of 1s in b(n).

Further, we might write a sequence c(n) containing primes q = π(n) for which b(n) = 1 (see code 3.1):

2, 3, 7, 13, 17, 31, 37, 61, 79, 83, 89, 103, 109, 131, 151, 179, 223, 233, 251, ...

In other words, these are the n-th primes q for indices n of 1s in b(n). For these primes q, q | a(n) ONLY for n ≡ −1 (mod q − 1), and for no other residue.

Sequence s(n).

We define a sequence s(n) that lists the least prime p with n residues r such that p | a(n) for nr (mod p − 1).

Let’s start by examining the record transform of b(n), finding records m at index n, also listing π(n) in Table 4.1 (See codes 4.1, 4.2):

   m      n     π(n)
   1      1       2
   2      3       5
   4      9      23
   8     25      97
  10     83     431
  12    117     643
  16    197    1201
  20    456    3221
  56    847    6553
  72   3358   31177
  ...

The sparsity of Table 4.1, given 10000 terms of b(n), suggests examining the least indices n where a given value m first appears in b(n) in Table 4.2 (See code 4.3):

   m      n     π(n)
-------------------
   1      1       2
   2      3       5
   3     37     157
   4      9      23
   5    164     971
   6     35     149
   7    732    5531
   8     25      97
   9     85     439
  10     83     431
  11   7774   79333
  12    117     643
  13   8113   83071
  14   1766   15121
  15   1876   16111
  16    197    1201
  17    848    6563
  18   1255   10243
  19   8884   91961
  ...

We might call column π(n) in this sequence s(n). Hence, the smallest prime p | A330170(n) ≡ r (mod p − 1) such that there is only 1 residue r is 2; and for 2 residues, 5, 3 residues 157, etc. Is s(n) defined for all n? We note that s(p) for p prime is generally greater than s(n) for adjacent composite n, but curiously not for p = 17, and that s(n) seems relatively small for n that are perfect powers of 2.

Triangle T(n) of residues r such that p | a(n) for nr (mod p − 1) for p in s(n).

Using s(n), we can produce a triangle of residues r for which p | A330170(n) ≡ r (mod p − 1) for p in s(n) (see code 5.1):

    0
    1      3
   89    124    155
    5     10     16     21
   63    280    562    621    969
   37     75     83    111    139    147
  789   1579   2369   3159   3949   4739   5529
   12     25     36     47     60     73     84    95
   91    134    145    237    280    291    383   426   437
   42     85    128    171    214    257    300   343   386   429
...

Thus clearly 2 | a(n) for all n;
5 | a(n) for n ≡ {1, 3} (mod 4), in other words, odd n;
157 | a(n) for n ≡ {89, 124, 155} (mod 156);
23 | a(n) for n ≡ {5, 10, 16, 21} (mod 22); etc.

We observe 5 | {10, 250, 8050, 282250, …},
157 | 1800782593726645086383198953559179330816574049035635349624276222902690;
23 | {8050, 60526248, …}, etc.

This concludes our examination of OEIS A330170.

Code 1.1: Generate A330170 algebraically:

Array[2^# + 3^# + 6^# - 1 &, 12]

Code 1.2: Generate A330170 as a linear recurrence::

LinearRecurrence[{12, -47, 72, -36}, {10, 48, 250, 1392}, 12]

Code 1.3: Generate A330170 via generating function:

Rest@ CoefficientList[Series[2 x (5 - 36 x + 72 x^2 - 36 x^3)/((1 - x) (1 - 2 x)*(1 - 3 x)*(1 - 6 x)), {x, 0, 12}], x]

Code 2.1: Generate b(n):

Block[{nn = 10^3, s},
  s = Array[2^# + 3^# + 6^# - 1 &, Prime@ nn];
  Array[Function[p, Count[s[[1 ;; p - 1]], _?(Mod[#, p] == 0 &)]]@
  Prime@ # &, nn]]

Code 3.1: Generate c(n):

Block[{nn = 10^3, s},
  s = Array[2^# + 3^# + 6^# - 1 &, Prime@ nn];
  Position[#, 1]&@ Array[Function[p, Count[s[[1 ;; p - 1]], _?(Mod[#, p] == 0 &)]]@
  Prime@ # &, nn] ]

Code 4.1: Records transform of b(n), assuming variable b stores b(n):

Union@ FoldList[Max, b]

Code 4.2: Indices of records in b(n), assuming variable b stores b(n):

Map[FirstPosition[b, #][[1]] &, Union@ FoldList[Max, b]]

We might prepend Prime@ in front of the above code so as to yield the corresponding primes π(n).

Code 4.3: Produce Table 4.2, assuming variable s stores s(n):

Map[{#1, #2, Prime[#2]} & @@ {#, FirstPosition[s, #][[1]]} &,
  #[[1 ;; LengthWhile[Differences@ #, # == 1 &]]] &@ Union@ s] // TableForm

Code 5.1: Produce triangle T(n), assuming variable a stores a(n), and variable s stores s(n):

Map[Function[p,
  Position[a[[1 ;; p - 1]],
    _?(Mod[#, p] == 0 &)][[All, 1]] ]@ Prime@ # &,
  Map[FirstPosition[s, #][[1]] &,
      Union[s][[1 ;; 10]] ] ] // TableForm

Concerns sequences:

A330170: a(n) = 2n + 3n + 6n − 1.
b(n) = Number of residues r such that prime(n) = p | A330170(n) for nr (mod p − 1).
c(n) = Primes p such that p divides A330170(n) only for n ≡ −1 (mod p − 1).
s(n) = Least prime p with n residues r such that p | A330170(π(p)) for π(p) r (mod p − 1).
T(n): row n lists residues r (mod p − 1) such that prime A336685(n) = p | A330170(π(p)) for π(p) ≡ r.

Document Revision Record.

2020 0730 2200 Created.
2020 0802 0745 Revised, renamed A336683 from A330170.
2020 1004 2130 Reverted to A330170.