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: Martins Opmanis

Martins Opmanis's wiki page.

Martins Opmanis has authored 7 sequences.

A363370 Number of ways to distribute n guards on the corners and walls of a square castle so that each wall has an equal number of guards modulo rotations and reflections.

Original entry on oeis.org

1, 0, 1, 1, 3, 2, 5, 4, 9, 8, 13, 13, 22, 20, 30, 31, 44, 44, 60, 61, 82, 84, 106, 111, 141, 144, 177, 186, 225, 234, 279, 291, 345, 360, 417, 438, 508, 528, 604, 634, 720, 752, 848, 886, 996, 1040, 1156, 1210, 1345, 1400, 1545, 1615, 1775, 1850, 2025, 2110
Offset: 0

Author

Martins Opmanis, May 29 2023

Keywords

Comments

The four walls of the castle are defended by n guards, each of whom is assigned to one of eight locations in the castle: one of the four towers at the corners of the castle, or the middle of one of the four walls. Each guard in a tower will defend the two adjoining walls, while each guard positioned at the middle of a wall will guard only that wall. The guards must be distributed so that each wall is defended by the same number of guards. If two distributions can be obtained from one another by reflection and/or rotation, they are counted as one.

Examples

			For n = 5 there are two distinct distributions:
  2-0-0    1-1-0
  |   |    |   |
  0   1    0   1
  |   |    |   |
  0-1-1    1-0-1
		

Programs

  • PARI
    Vec((1/((1 - x^6)*(1 - x^4)) + 1/((1 - x^3)*(1 - x^2))^2)/(2*(1 - x^4)) + O(x^61)) \\ Andrew Howroyd, May 29 2023

Formula

G.f.: (1/((1 - x^6)*(1 - x^4)) + 1/((1 - x^3)*(1 - x^2))^2)/(2*(1 - x^4)). - Andrew Howroyd, May 29 2023

Extensions

Terms a(22) and beyond from Andrew Howroyd, May 29 2023

A317636 Minimum number of consecutive positive integers starting with 1 that must be concatenated in descending order so that n divides the concatenation, or zero if n divides no such concatenation.

Original entry on oeis.org

1, 0, 2, 0, 0, 0, 2, 0, 8, 0, 14, 0, 15, 0, 0, 0, 9, 0, 5, 0, 2, 0, 16, 0, 0, 0, 26, 0, 4, 0, 25, 0, 14, 0, 0, 0, 21, 0, 15, 0, 40, 0, 67, 0, 0, 0, 78, 0, 54, 0, 9, 0, 66, 0, 0, 0, 5, 0, 25, 0, 111, 0, 44, 0, 0, 0, 161, 0, 18, 0, 49, 0, 30, 0, 0, 0, 73, 0, 15, 0, 27, 0, 27, 0, 0, 0, 41, 0, 20, 0, 54, 0, 47, 0, 0, 0, 63, 0, 18, 0, 98, 0, 102, 0, 0, 0, 3, 0, 99, 0, 21
Offset: 1

Author

Martins Opmanis, Aug 02 2018

Keywords

Comments

a(n) = 0 if n is even or a multiple of 5. Empirical observation: a(n) > 0 for all other n values.

Examples

			For n=19 the a(19)=5 since 54321 = 19*2859, while 4321, 321, 21 and 1 are not multiples of 19.
		

Crossrefs

Programs

  • Mathematica
    Table[If[GCD[n, 10] == 1, Block[{k = 1}, While[Mod[FromDigits@ Flatten@ Map[IntegerDigits, Range[k, 1, -1]], n] != 0, k++]; k],0], {n, 111}] (* Michael De Vlieger, Aug 02 2018 *)
  • PARI
    a(n) = {if ((n%2) && (n%5), my(s = ""); for (k=1, oo, s = concat(Str(k), s); if (!(eval(s) % n), return (k)););); return (0);} \\ Michel Marcus, Aug 02 2018
  • Pascal
    program skaitlirinda2;
    var i : longint;
    function Atrodi(n : longint) : int64;
    var sk, koefa, naksk, rez : int64;
    begin
       sk := 1;
       naksk := 10;
       koefa := naksk mod n;
       rez := sk mod n;
       while rez>0 do
        begin
         Inc(sk);
         rez := (sk * koefa + rez) mod n;
         if sk=naksk then naksk := naksk * 10;
         koefa := (koefa*naksk) mod n;
        end;
       Atrodi := sk;
    end;
    begin
      for i:=1 to 10000 do
       begin
        if (i mod 2)*(i mod 5) > 0 then writeln(i,' ',Atrodi(i)) else writeln(i,' 0');
       end;
    end.
    

A271730 Each number is the sum of the cubes of its 3 sections (not necessarily having the same length and without leading zeros).

Original entry on oeis.org

153, 370, 371, 407, 1000, 1001, 2213, 4160, 4161, 41833, 165033, 221859, 341067, 444664, 487215, 982827, 983221, 166500333, 296584415, 710656413, 828538472, 3351425749, 4741646560, 5363441729, 6410801727, 13681182232, 15812239860, 16066842264, 18722248929, 67229383464
Offset: 1

Author

Martins Opmanis, Apr 19 2016

Keywords

Comments

Sequence A056733 is quite similar, except that in the present sequence no leading 0's are allowed (except 0 itself) and sections may be of different length.

Examples

			1000 = 10^3 + 0^3 + 0^3 is a term, 2213 = 2^3 + 2^3 + 13^3 is a term too.
		

Crossrefs

Cf. A056733.

A187924 a(n) is the smallest multiple of n such that a(n) ends with n and S(a(n))=n where S(m) is the sum of the base ten digits of m, or 0 if no such a(n) exists.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 910, 0, 912, 11713, 6314, 915, 3616, 15317, 918, 17119, 9920, 18921, 9922, 82823, 19824, 9925, 46826, 18927, 18928, 78329, 99930, 585931, 388832, 1098933, 198934, 289835, 99936, 99937, 478838, 198939, 1999840
Offset: 1

Author

Martins Opmanis, Mar 16 2011

Keywords

Comments

It can be proved that a(11)=0 and, for infinitely many n, a(n) is the least integer with S(n)=n. Conjecture: 11 is the only n for which a(n)=0.
The conjecture is correct. Let m = (n*10^((n-S(n))/9) - n) * 10^floor(1+log_10(n)) + n. If n != 11, then it can be proved that m has all the required properties of a(n) except that it may not be the smallest candidate. If n=11, then S(m)=20 instead of the required 11. - Ørjan Johansen, Dec 08 2017

Examples

			For n=13 11713 is the least integer which is multiple of 13, ends with "13" and sum of digits in decimal notation also is 13.
		

Crossrefs

A075154 is similar but limited to equivalence of last two digits; therefore at least the first 99 terms are the same in both sequences.

Programs

  • Mathematica
    Table[If[n == 11, 0, Block[{k = 1}, While[Nand[FromDigits@ Take[#, -IntegerLength@ n] == n, Total@ # == n] &@ IntegerDigits[k n], k++]; k n]], {n, 40}] (* Michael De Vlieger, Dec 09 2017 *)
  • PARI
    a(n) = {if (n == 11, return (0)); my(k = 1); while (!((sumdigits(k*n) == n) && (nd = #digits(n)) && !((k*n - n) % 10^nd)), k++); k*n;} \\ Michel Marcus, Dec 23 2017

Extensions

Name corrected by Michel Marcus, Dec 24 2017

A161759 n occurs n times, as early as possible subject to the constraint that two successive occurrences of n are separated by exactly n terms.

Original entry on oeis.org

1, 2, 3, 4, 2, 5, 3, 6, 4, 14, 3, 5, 19, 4, 6, 21, 9, 5, 4, 40, 54, 6, 79, 5, 14, 7, 9, 69, 6, 5, 146, 74, 19, 7, 89, 6, 9, 21, 29, 14, 164, 7, 6, 99, 104, 230, 9, 188, 209, 7, 335, 529, 19, 139, 14, 329, 9, 7, 149, 21, 40, 750, 559, 174, 44, 7, 9, 349, 29, 14, 999, 1273, 19, 7
Offset: 1

Author

Martins Opmanis, Jun 18 2009

Keywords

Examples

			Index of the first occurrence of 2 is 2 and that of the second occurrence is 5, separated by a(3) and a(4), two terms.
		

Crossrefs

A168570 Exponent of 3 in 2^n - 1.

Original entry on oeis.org

0, 1, 0, 1, 0, 2, 0, 1, 0, 1, 0, 2, 0, 1, 0, 1, 0, 3, 0, 1, 0, 1, 0, 2, 0, 1, 0, 1, 0, 2, 0, 1, 0, 1, 0, 3, 0, 1, 0, 1, 0, 2, 0, 1, 0, 1, 0, 2, 0, 1, 0, 1, 0, 4, 0, 1, 0, 1, 0, 2, 0, 1, 0, 1, 0, 2, 0, 1, 0, 1, 0, 3, 0, 1, 0, 1, 0, 2, 0, 1, 0, 1, 0, 2, 0, 1, 0, 1, 0, 3, 0, 1, 0, 1, 0, 2, 0, 1, 0, 1, 0, 2, 0, 1, 0
Offset: 1

Author

Martins Opmanis, Nov 30 2009

Keywords

Comments

Records: a(A025192(n)) = n and a(k) < n for k < A025192(n). [Joerg Arndt, Apr 07 2014]

Examples

			For n=6, 2^6 - 1 = 63. Greatest divisor of 63 which is a power of 3 is 9 (3^2).
		

Crossrefs

Cf. A051064 (without the zeros).

Programs

  • Maple
    a:= n-> padic[ordp](2^n-1, 3):
    seq(a(n), n=1..120);  # Alois P. Heinz, Mar 27 2017
  • Mathematica
    Table[IntegerExponent[2^n - 1, 3], {n, 100}] (* T. D. Noe, Apr 13 2014 *)
  • PARI
    vector(100,n,valuation(2^n-1,3)) /* Joerg Arndt, Jun 13 2011 */

A177834 Opmanis's sequence: a(n) is the smallest integer k such that k or one of its nonzero substrings (regarded as an integer) is divisible by every integer in the range 1 through n.

Original entry on oeis.org

1, 2, 6, 12, 45, 54, 56, 56, 245, 504, 1440, 1440, 5044, 5044, 10456, 10569, 11704, 11704, 11704, 13608, 13608, 13608, 26460, 26460, 198007, 258064, 264600, 264600, 475440, 475440, 1754608, 1754608, 2258064, 2258064, 2646004, 2646004, 2992520
Offset: 1

Author

Martins Opmanis, May 14 2010

Keywords

Comments

Comment from N. J. A. Sloane, May 28 2010: (Start)
The factorizations of the initial terms are:
1, 2, 2*3, 2^2*3, 3^2*5, 2*3^3, 2^3*7, 2^3*7, 5*7^2, 2^3*3^2*7, 2^5*3^2*5, 2^5*3^2*5, 2^2*13*97, 2^2*13*97, 2^3*1307, 3*13*271, 2^3*7*11*19,
2^3*7*11*19, 2^3*7*11*19, 2^3*3^5*7, 2^3*3^5*7, 2^3*3^5*7, 2^2*3^3*5*7^2, 2^2*3^3*5*7^2, 23*8609, 2^4*127^2, 2^3*3^3*5^2*7^2, 2^3*3^3*5^2*7^2, 2^4*3*5*7*283,
2^4*3*5*7*283, 2^4*109663, 2^4*109663, 2^4*3^3*5227, 2^4*3^3*5227, 2^2*139*4759, 2^2*139*4759, 2^3*5*79*947, ...
The name "Opmanis's sequence" is due to N. J. A. Sloane, not the author. (End)

Examples

			a(8)=56 because 56 is divisible by 1,2,4,7,8; 5 is divisible by 5; 6 is divisible by 3 and 6. Therefore the set {1,2,3,4,5,6,7,8} is covered by the divisors. 56 is the smallest number with this property.
		

Crossrefs

Cf. A003418 (a weak upper bound), A169819, A169858, A178544.

Programs

  • Mathematica
    k = 1; lst = {}; mx = 0; f[n_] := Block[{a, d, id = IntegerDigits@ n}, a = Complement[ Union[ FromDigits /@ Flatten[ Table[ Partition[ id, k, 1], {k, Length@ id}], 1]], {0}]; d = Union[ Flatten[ Divisors /@ a]]; Complement[ Range@ 100, d][[1]] - 1]; While[k < 3000000, a = f@k; If[a > mx, Print[{a, k}]; AppendTo[lst, k]; mx = a]; k++ ] (* Zak Seidov & Robert G. Wilson v, May 30 2010 *)
  • Python
    def substrings(n): # returns set of nonzero substrings of n
        s = str(n)
        ss = (s[i:j] for i in range(len(s)) for j in range(i+1, len(s)+1))
        return set(int(sij) for sij in ss) - {0}
    def a(n, startk=1):
        k = startk
        while True:
            subsk = substrings(k)
            if all(any(kij%m == 0 for kij in subsk) for m in range(1, n+1)):
                return k
            k += 1
    def afind():
        n, an = 1, 1
        while True:
            n, an = n+1, a(n, startk=an)
            print(an, end=", ")
    afind() # Michael S. Branicky, Jan 22 2022

Extensions

Edited by N. J. A. Sloane, May 28 2010
a(1)-a(37) confirmed by Zak Seidov, May 28 2010