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: Stéphane Rézel

Stéphane Rézel's wiki page.

Stéphane Rézel has authored 4 sequences.

A335717 a(n) is the smallest dividend m of the Euclidean division m = d*n + r such that m/d = r/n.

Original entry on oeis.org

25, 100, 162, 676, 400, 2500, 1156, 2352, 1458, 14884, 2601, 28900, 5202, 6084, 8712, 84100, 9408, 131044, 10816, 22500, 22275, 280900, 19602, 79380, 36517, 60516, 40000, 708964, 31827, 925444, 67600, 46128, 80937, 62500, 55112, 1876900, 112651, 88752, 83232
Offset: 2

Author

Stéphane Rézel, Jun 18 2020

Keywords

Comments

Such a Euclidean division exists, for all n>1, with r = n^2 + 1 because then m = r^2 and d = n*r. This solution leads to the largest possible dividend, given (for n>1) by A082044(n). This is also the only solution when n is prime, then a(n) = A082044(n).
Solutions with r = n^2 + k are only possible for most of the integers k < n such that any prime factor of k is also a prime factor of n. The largest such integers k are given by A079277(n). In the present sequence, k is not always this largest integer: a(18) is defined by k = 12 while it cannot be defined by k = 16 = A079277(18).

Examples

			a(2) = 25 because 25 = 10*2 + 5 and 25/10 = 5/2. Furthermore, there is no Euclidean division with a dividend less than 25 such that m/d = r/2.
a(4) = 162 because 162 = 36*4 + 18 and 162/36 = 18/4. The other Euclidean division with the same property has a larger dividend : 289 = 68*4 + 17 and 289/68 = 17/4.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local m, r,k,d;
      for k from n-1 to 1 by -1 do
        r:= n^2+k;
        m:= r^2/k;
        if not m::integer then next fi;
        d:= n*r/k;
        if d::integer then return m fi;
      od
    end proc:
    map(f, [$2..50]); # Robert Israel, Sep 16 2020
  • Mathematica
    f[n_] := Module[{m, r, k, d}, For[k = n-1, k >= 1, k--, r = n^2+k; m = r^2/k; If[!IntegerQ[m], Continue]; d = n*r/k; If[IntegerQ[d], Return[m]]]];
    Table[f[n], {n, 2, 50}] (* Jean-François Alcover, Jul 31 2024, after Robert Israel *)
  • PARI
    a(n) = k=n; until(k==1, k--; r=k + n^2; d=n*r/k; m=r^2/k; if(floor(d)==d && floor(m)==m, return(m); break));

A327886 Digits d in decimal expansion of n replaced with d-th digit of n (keeping the digits 0). If n does not have enough digits to index, the indexing resumes at the first digit of n as many times as necessary to find the substitution digit. Leading zeros are erased unless the result is 0.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 11, 14, 11, 16, 11, 18, 11, 0, 12, 22, 32, 44, 52, 66, 72, 88, 92, 30, 33, 32, 33, 34, 33, 36, 33, 38, 33, 0, 14, 22, 34, 44, 54, 66, 74, 88, 94, 50, 55, 52, 55, 54, 55, 56, 55, 58, 55, 0, 16, 22, 36, 44, 56, 66, 76
Offset: 0

Author

Stéphane Rézel, Sep 29 2019

Keywords

Comments

For all numbers n, the iterated map n -> a(n) gives a loop of numbers linked by permutations of their digits, consisting of k-cycles, with k always odd. Indeed, for k even, each iteration divides k by 2. After a few steps, we obtain a fixed point or a loop of 2, 3, 4 or 6, generated respectively by:
- the identity,
- 2 permutations consisting of one, two or three 3-cycle,
- 3 permutations of 7-cycle,
- 4 permutations of 5-cycle,
- 6 permutations of 9-cycle.
Thus, the smallest numbers n giving such loops are respectively 0, 231, 2345671, 23451 and 234567891. There is no step before loop of 6 because the permutation applies directly to all nonzero digits. Also applicable to other bases, the loop length is the least common multiple of multiplicative orders of 2 modulo the different values of k.

Examples

			For n=23, the digit 2 is replaced by three, because it is the second digit of n. Next, the digit 3 cannot be replaced directly because n has no third digit. After counting the first two digits of n, the indexing resumes at the first digit of n which corresponds here to the third ordinal: the digit 3 is thus replaced by two. In summary: a(23) = {2nd digit of n, 1st digit of n} = {3, 2} = 32.
a(2056748) = {0, 0, 7, 4, 8, 6, 2} = 74862.
		

Crossrefs

Cf. A002326.

Programs

  • Mathematica
    Array[FromDigits@ Map[# /. k_ /; ! IntegerQ@ k -> 0 &, PadRight[#, 9, #][[#]]] &@ IntegerDigits[#] &, 67] (* Michael De Vlieger, Sep 30 2019 *)
  • PARI
    a(n) = {if (n==0, return (0)); my(s = Str(n), d=digits(n)); if (#s < 9, my(i=1); while (#s < 9, s = concat(s, d[i]); i++; if (i>#d, i=1))); my(dm = digits(eval(s))); my(ns=""); for (i=1, #d, if (dm[i], ns = concat(ns, dm[dm[i]]), ns = concat(ns, 0));); eval(ns);} \\ Michel Marcus, Sep 30 2019

A329451 Maximum number of pieces that can be captured during one move on an n X n board according to the international draughts capture rules.

Original entry on oeis.org

0, 0, 0, 1, 1, 4, 5, 9, 10, 16, 19, 25, 28, 36, 41, 49, 54, 64, 71, 81, 88, 100, 109, 121, 130, 144, 155, 169, 180, 196, 209, 225, 238, 256, 271, 289, 304, 324, 341, 361, 378, 400, 419, 441, 460, 484, 505, 529, 550, 576, 599, 625, 648, 676, 701, 729, 754, 784
Offset: 0

Author

Stéphane Rézel, Nov 14 2019

Keywords

Comments

Captures are made diagonally, forward and backward. Kings have the long-range capturing capability. During the multiple capture, a piece may pass over the same empty square several times, but no opposing piece can be jumped twice. Captured pieces can only be lifted from the board after the end of the multiple capture.

Examples

			It is possible to capture in a single move 19 opposing pieces on a 10 X 10 board, but not one more, so a(10) = 19.
		

Crossrefs

Cf. A000290, A059193, A125202, A000982 (active squares).

Programs

  • PARI
    a(n) = if(n<5, floor(n/3), (n^2 - 2*n + if(n%2, 1, 2*(n%4) - 8))/4)

Formula

a(2*t+1) = t^2 = A000290(t).
a(4*t+6) = 4*t^2 + 10*t + 5 = A125202(t+2).
a(4*t+8) = 4*t^2 + 14*t + 10 = A059193(t+2).
a(0) = a(2) = 0; a(4) = 1.
Recurrence: For t >= 1, a(2*t+1) = a(2*t-1) + 2*t - 1;
For t >= 1, a(4*t+3) = a(4*t+2) + 2*t + 2; a(4*t+2) = a(4*t+1) + 2*t - 1;
For t >= 2, a(4*t+1) = a(4*t) + 2*t + 2; a(4*t) = a(4*t-1) + 2*t - 3.
From Colin Barker, Nov 14 2019: (Start)
G.f.: x^3*(1 - x + 3*x^2 - 2*x^3 + 2*x^4 - 2*x^5 + 2*x^6 - x^7) / ((1 - x)^3*(1 + x)*(1 + x^2)).
a(n) = 2*a(n-1) - a(n-2) + a(n-4) - 2*a(n-5) + a(n-6) for n>10.
(End)

A309654 Numbers k such that k multiplied by the sum of reciprocals of digits is the digit reversal of k.

Original entry on oeis.org

1, 22, 333, 424, 864, 3663, 4444, 6336, 39993, 46664, 48484, 55555, 64646, 66366, 84448, 88288, 93939, 362436, 488884, 666666, 848848, 884488, 6699966, 6886886, 6969696, 7777777, 8686868, 8866688, 8884888, 9669669, 9993999, 18181818, 26666664, 36484836
Offset: 1

Author

Stéphane Rézel, Aug 11 2019

Keywords

Comments

Integers with at least one 0 digit cannot be terms. There is no other palindrome after 999999999, but is the sequence complete? The non-palindromic numbers in the sequence are 864, 362436, 18181818, 26666664, 36484836, 48363648 and 1666516665, in which zero, seven and nine do not appear as a digit. These non-palindromes are multiples of 3 and have a multiple of 6 as the sum of their digits.
The sequence is finite because the sum of the reciprocals of the digits of every zeroless number greater than 10^81-1 exceeds 9, while the ratio R(n)/n is always smaller than 9. a(43) > 10^13, if it exists. - Giovanni Resta, Aug 12 2019

Examples

			864 is in the sequence because 864 * (1/8 + 1/6 + 1/4) = 468, the digit reversal of 864.
		

Crossrefs

Cf. A037268.

Programs

  • Magma
    [k:k in [1..4000000]| not 0 in Set(Intseq(k))  and k*(&+[1/Intseq(k)[i]:i in [1..#Intseq(k)]]) eq Seqint(Reverse(Intseq(k)))]; // Marius A. Burtea, Aug 11 2019
  • Mathematica
    Select[Range[365*10^5],#*Total[1/IntegerDigits[#]]==IntegerReverse[#]&]//Quiet (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Aug 09 2020 *)
  • PARI
    isok(k) = my(d=digits(k)); if (vecmin(d), k*sum(i=1, #d, 1/d[i]) == fromdigits(Vecrev(d))); \\ Michel Marcus, Aug 11 2019