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.

Showing 1-5 of 5 results.

A171947 P-positions for game of UpMark.

Original entry on oeis.org

1, 3, 7, 9, 11, 15, 19, 23, 25, 27, 31, 33, 35, 39, 41, 43, 47, 51, 55, 57, 59, 63, 67, 71, 73, 75, 79, 83, 87, 89, 91, 95, 97, 99, 103, 105, 107, 111, 115, 119, 121, 123, 127, 129, 131, 135, 137, 139, 143, 147, 151, 153, 155, 159, 161, 163, 167, 169, 171, 175, 179
Offset: 1

Views

Author

N. J. A. Sloane, Oct 29 2010

Keywords

Comments

The following description, due to D. R. Hofstadter, Email, Oct 23 2014, is presumably equivalent to Fraenkel's. Begin with 1, and then each new member is 2k-1, where k is the smallest unused non-member of the sequence. Thus k starts out as 2, so 2k-1 = 3, so 3 is the sequence's second member. The next value of k is 4, giving 2k-1 = 7, so 7 is the sequence's third member. Then k = 5, so 9 is the next member. Then k = 6, so 11 is the next member. Then k = 8, so 15 is the next member. Etc. - N. J. A. Sloane, Oct 26 2014
It appears that this is the sequence of positions of 1 in the 1-limiting word of the morphism 0 -> 10, 1 -> 00; see A284948. - Clark Kimberling, Apr 18 2017
It appears that this sequence gives the positions of 0 in the limiting 0-word of the morphism 0 -> 11, 1 -> 01. See A285383. - Clark Kimberling, Apr 26 2017
It appears that this sequence gives integers that are congruent to 2^k+1 (mod 2^(k+1)), where k is any odd integer >=1. - Jules Beauchamp, Dec 04 2023

Crossrefs

Complement of A171946. Essentially identical to A072939.
A249034 gives missing odd numbers.
Cf. A003159.

Programs

  • Haskell
    import Data.List (delete)
    a171947 n = a171947_list !! (n-1)
    a171947_list = 1 : f [2..] where
       f (w:ws) = y : f (delete y ws) where y = 2 * w - 1
    -- Reinhard Zumkeller, Oct 26 2014
    
  • Maple
    # Maple code for M+1 terms of sequence, from N. J. A. Sloane, Oct 26 2014
    m:=1; a:=[m]; M:=100;
    for n from 1 to M do
    m:=m+1; if m in a then m:=m+1; fi;
    c:=2*m-1;
    a:=[op(a),c];
    od:
    [seq(a[n],n=1..nops(a))];
  • Mathematica
    f[n_] := Block[{a = {1}, b = {}, k}, Do[k = 2; While[MemberQ[a, k] || MemberQ[b, k], k++]; AppendTo[a, 2 k - 1]; AppendTo[b, k], {i, 2, n}]; a]; f@ 120 (* Michael De Vlieger, Jul 20 2015 *)
  • Python
    def A171947(n):
        def bisection(f,kmin=0,kmax=1):
            while f(kmax) > kmax: kmax <<= 1
            kmin = kmax >> 1
            while kmax-kmin > 1:
                kmid = kmax+kmin>>1
                if f(kmid) <= kmid:
                    kmax = kmid
                else:
                    kmin = kmid
            return kmax
        def f(x):
            c, s = n+x-1, bin(x-1)[2:]
            l = len(s)
            for i in range(l&1,l,2):
                c -= int(s[i])+int('0'+s[:i],2)
            return c
        return bisection(f,n,n) # Chai Wah Wu, Jan 29 2025

Formula

Presumably equal to 2*A003159 + 1. - Reinhard Zumkeller, Oct 26 2014

A260182 Smallest square that is pandigital in base n.

Original entry on oeis.org

4, 64, 225, 5329, 38025, 314721, 3111696, 61058596, 1026753849, 31529329225, 892067027049, 307197306432025, 803752551280900, 29501156485626049, 1163446635475467225, 830482914641378019961, 2200667320658951859841, 104753558229986901966129, 5272187100814113874556176
Offset: 2

Views

Author

Jon E. Schoenfield, Jul 17 2015

Keywords

Comments

Compare this sequence with A260117, Smallest triangular number that is pandigital in base n. Presumably, lim_{n->infinity} A260117(n)/A049363(n) = 1, but the same cannot be true for this sequence: the sum of the base-n digits of a number that is pandigital in base n must be 0+1+2+...+n-1 = binomial(n,2), but there are certain values of n for which no n-digit square can have a digit sum of binomial(n,2); for such values of n, a(n) must have more than n digits in base n. [E.g., the base-13 expansion of every square has a digit sum s == {0,1,4,9} (mod 12) (cf. A096008), but a square that is pandigital in base 13 and has exactly 13 digits would have a digit sum s = 78 == 6 (mod 12), so no such number exists; a 14-digit base-13 pandigital square would have each of the digits 0..12 exactly once except for one duplicated digit, which would have to be 3, 6, 7, or 10 (to yield a digit sum of 81, 84, 85, or 88, whose residues modulo 12 are 9, 0, 1, and 4, respectively). - Jon E. Schoenfield, Mar 23 2019]
The values of n for which there exists no pandigital square that is exactly n digits long (in base n) begin with 2, 3, 5, 13, 17, 21, ...; presumably, for all such values of n, a(n) is exactly n+1 base-n digits long.
In base 2, there are no 2-digit squares at all, so a(2) must have more than 2 binary digits. For n = 3, 5, 13, 17, 21, ..., there exists no square, regardless of its number of digits, whose base-n digit sum equals binomial(n,2); see A260191.

Examples

			Using the letters a, b, c, ... to represent digit values 10, 11, 12, ..., the terms begin as follows:
.
   n            a(n) in base 10          a(n) in base n
  ==  =========================  ======================
   2                          4                   100_2
   3                         64                  2101_3
   4                        225                  3201_4
   5                       5329                132304_5
   6                      38025                452013_6
   7                     314721               2450361_7
   8                    3111696              13675420_8
   9                   61058596             136802574_9
  10                 1026753849            1026753849_10
  11                31529329225           1240a536789_11
  12               892067027049          124a7b538609_12
  13            307197306432025        10254773ca86b9_13
  14            803752551280900        10269b8c57d3a4_14
  15          29501156485626049       102597bace836d4_15
  16        1163446635475467225      1025648cfea37bd9_16
  17      830482914641378019961    101246a89cgfb357ed_17
  18     2200667320658951859841    10236b5f8eg4ad9ch7_18
  19   104753558229986901966129   10234dhbg7ci8f6a9e5_19
  20  5272187100814113874556176  1024e7cdi3hb695fja8g_20
		

Crossrefs

A260191 Numbers m such that there exists no square whose base-m digit sum is binomial(m,2).

Original entry on oeis.org

3, 5, 13, 17, 21, 29, 37, 45, 49, 53, 61, 65, 69, 77, 81, 85, 93, 101, 109, 113, 117, 125, 133, 141, 145, 149, 157, 165, 173, 177, 181, 189, 193, 197, 205, 209, 213, 221, 229, 237, 241, 245, 253, 257, 261, 269, 273, 277, 285, 293, 301, 305, 309, 317, 321, 325
Offset: 1

Views

Author

Jon E. Schoenfield, Jul 18 2015

Keywords

Comments

After the initial term a(1)=3 (see Example), this sequence consists of all numbers of the form (2j-1)*4^k+1 where j and k are positive integers.
For each term m > 3, no square has a base-m digit sum == binomial(m,2) (mod 4).
After the initial term a(1)=3, is this A249034?

Examples

			No square has a base-3 digit sum of exactly binomial(3,2)=3, so 3 is in the sequence.
Binomial(5,2) = 10 == 2 (mod 4), but no square has a base-5 digit sum == 2 (mod 4), so there cannot be a square whose base-5 digit sum is 10; thus, 5 is in the sequence.
		

Crossrefs

Programs

  • Python
    from itertools import count, islice
    def A260191_gen(startvalue=3): # generator of terms >= startvalue
        c = max(startvalue,3)
        if c<=3: yield 3
        for n in count(c+(c&1^1),2):
            if (~(m:=n-1>>1) & m-1).bit_length()&1:
                yield n
    A260191_list = list(islice(A260191_gen(),20)) # Chai Wah Wu, Feb 26 2024

A340501 Smallest square which when written in base b contains each digit exactly once, or -1 if no such square exists.

Original entry on oeis.org

-1, -1, 225, -1, 38025, 314721, 3111696, 61058596, 1026753849, 31529329225, 892067027049, -1, 803752551280900, 29501156485626049, 1163446635475467225, -1, 2200667320658951859841, 104753558229986901966129, 5272187100814113874556176, -1, 15588378150732414428650569369
Offset: 2

Views

Author

N. J. A. Sloane, Jan 13 2021

Keywords

Comments

Note that "pandigital" just means every digit appears at least once. The condition here is stronger. Maybe this should be called "Smallest strictly pandigital square in base b"?
Does this sequence contain infinitely many positive terms? Equally, is A339693 infinite?
It is shown in A258103 that a(n) = -1 for n = 2,3,5,13,17,21 and infinitely many other values.

Examples

			  base       a(base)  digits
   4             225 [3, 2, 0, 1]
   6           38025 [4, 5, 2, 0, 1, 3]
   7          314721 [2, 4, 5, 0, 3, 6, 1]
   8         3111696 [1, 3, 6, 7, 5, 4, 2, 0]
   9        61058596 [1, 3, 6, 8, 0, 2, 5, 7, 4]
  10      1026753849 [1, 0, 2, 6, 7, 5, 3, 8, 4, 9]
  11     31529329225 [1, 2, 4, 0, 10, 5, 3, 6, 7, 8, 9]
  12    892067027049 [1, 2, 4, 10, 7, 11, 5, 3, 8, 6, 0, 9]
  14 803752551280900 [1, 0, 2, 6, 9, 11, 8, 12, 5, 7, 13, 3, 10, 4]
		

Crossrefs

Inspired by A258103, A260182, A339693.

Programs

  • Python
    from sympy import integer_nthroot
    def digits(n, b):
      out = []
      while n >= b: n, r = divmod(n, b); out.append(r)
      return [n] + out[::-1]
    def a(n):
      b, b2b = n, n**n
      r, a = integer_nthroot(b**(b-1), 2); s = r**2
      while s < b**(b-1): s += 2*r + 1; r += 1
      while s < b2b:
        if len(set(digits(s, b))) == n: return s
        s += 2*r + 1; r += 1
      return -1
    print([a(n) for n in range(2, 13)]) # Michael S. Branicky, Jan 13 2021

Extensions

a(10)-a(22) from Hugo Pfoertner and Alois P. Heinz, Jan 13 2021

A386987 For n >= 2, a(n) is the least r >= 1 such that T(n - r) + ... + T(n - 1) = T(n + 1) + ... + T(n + r) where T(i) is A010060(i).

Original entry on oeis.org

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

Views

Author

Ctibor O. Zizka, Aug 12 2025

Keywords

Comments

a(n) is from {1, 2, 3, 4}.

Examples

			For n = 6: T(6 - r) + ... + T(5) = T(7) + ... + T(6 + r) is true for the least r = 4  because A010060(2) + A010060(3) + A010060(4) + A010060(5) = A010060(7) + A010060(8) + A010060(9) + A010060(10), thus a(6) = 4.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Module[{s = 0, r = 1}, While[r <= n && (r == 1 || s != 0), s += (ThueMorse[n - r] - ThueMorse[n + r]); r++]; r-1]; Array[a, 100, 2] (* Amiram Eldar, Aug 12 2025 *)

Formula

a(A081706(n) + 1) = 1.
a(2*A079523(n)) = 2.
a(A249034(n))= 2.
a(A225822(n)) = 3.
a(A056196(n)) = 3.
a(2*A131323(n)) = 4.
a(2*A249034(n) - 1) = 4.
Showing 1-5 of 5 results.