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: Adam J.T. Partridge

Adam J.T. Partridge's wiki page.

Adam J.T. Partridge has authored 5 sequences.

A262433 Quater-imaginary representation of the Gaussian primes with an even imaginary part.

Original entry on oeis.org

3, 11, 13, 21, 31, 101, 111, 113, 123, 133, 201, 211, 213, 223, 233, 301, 321, 323, 331, 1003, 1011, 1021, 1031, 1033, 1101, 1113, 1123, 1131, 1133, 1201, 1203, 1213, 1223, 1231, 1233, 1311, 1321, 1323, 2001, 2011, 2031, 2033, 2103, 2113, 2131, 2133, 2203
Offset: 1

Author

Adam J.T. Partridge, Sep 22 2015

Keywords

Comments

Not all Gaussian primes will be in this list as complex numbers with an odd imaginary part require a value after the radix point (".") in the quater-imaginary number system.

Examples

			1231_(2i) = 1(2i)^3 + 2(2i)^2 + 3(2i)^1 + 1(2i)^0 = -7-2i which is a Gaussian prime.
		

Crossrefs

A002145 when translated using A212494 is a subsequence.
Real and imaginary parts of the Gaussian primes A103431, A103432.

A262222 Decimal representations of hexadecimal numbers that can be misinterpreted as decimal numbers in scientific E notation.

Original entry on oeis.org

480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 736, 737, 738, 739, 740, 741, 742, 743, 744, 745, 992, 993, 994, 995, 996, 997, 998, 999, 1000, 1001, 1248, 1249, 1250, 1251, 1252, 1253, 1254, 1255, 1256, 1257, 1504, 1505, 1506, 1507, 1508, 1509, 1510, 1511
Offset: 1

Author

Adam J.T. Partridge, Sep 16 2015

Keywords

Comments

Hexadecimal numbers containing no alpha digits other than a single "e", where the "e" is not the first or last digit (e.g., 3e12), may be misinterpreted as numbers in scientific E notation.
These numbers are especially troublesome when importing hexadecimal numbers from CSV files into Microsoft Excel.
These numbers can be written as 16^(i+1)a + 14*16^i + b where a and b are members of A102489 with a>0, b<16^i and i>0.
Numbers whose hexadecimal representation matches the regular expression [1-9][0-9]*e[0-9]+. - Eric M. Schmidt, Sep 28 2023

Examples

			480_10 = 1e0_16 and 1e0 = 1 in E notation.
739_10 = 2e3_16 and 2e3 = 2000_10 in E notation.
		

Crossrefs

A subset of A102490.

Programs

  • C
    #include 
    #define DIGIT_E 14
    bool isA262222(int k)
    {
        if (k <= 0 || k % 16 == DIGIT_E) return false;
        bool foundE = false;
        int digit;
        while (k > 0) {
            digit = k % 16;
            if (digit == DIGIT_E) {
                if (foundE) return false;
                foundE = true;
            }
            else if (digit > 9) return false;
            k /= 16;
        }
        return foundE && digit != DIGIT_E;
    } // Eric M. Schmidt, Sep 28 2023
  • Python
    from itertools import count,product
    # every string of d characters with exactly one 'e' in it, and all the other characters digits 0-9, in ascending lexicographic order
    def mids(d):
        if d<1:
            raise Exception("d<1")
        if d==1:
            yield 'e'
            return
        for i in range(0,10):
            for m in mids(d-1):
                yield str(i)+m
        for i in range(10**(d-1)):
            yield 'e'+str(i).zfill(d-1)
    def a_generator():
        for d in count(1):
            for start in range(1,10): # for each leading digit 1-9
                for mid in mids(d): # for all possible middles made of d characters, containing exactly one 'e'
                    for end in range(10): #for each possible final digit, 0-9
                        s = '{}{}{}'.format(start,''.join(mid),end)
                        i = int(s,16)
                        yield i
    a262222 = a_generator()
    [next(a262222) for  in range(48)] # _Christian Perfect, Oct 20 2015
    

A259368 Number of digits in n^n when written in binary.

Original entry on oeis.org

1, 3, 5, 9, 12, 16, 20, 25, 29, 34, 39, 44, 49, 54, 59, 65, 70, 76, 81, 87, 93, 99, 105, 111, 117, 123, 129, 135, 141, 148, 154, 161, 167, 173, 180, 187, 193, 200, 207, 213, 220, 227, 234, 241, 248, 255, 262, 269, 276, 283, 290, 297, 304, 311, 318, 326, 333
Offset: 1

Author

Adam J.T. Partridge, Jun 25 2015

Keywords

Examples

			For n=3, 3^3=11011_2 so a(3)=5.
		

Crossrefs

Programs

  • Magma
    [Floor(n*Log(n)/Log(2)) + 1: n in [1..70]]; // Vincenzo Librandi, Jul 15 2015
  • Mathematica
    Array[IntegerLength[#^#, 2] &, 60] (* or *)
    Array[Floor[# Log[2, #]] + 1 &, 60] (* Michael De Vlieger, Jul 03 2015 *)
  • PARI
    a(n) = #binary(n^n); \\ Michel Marcus, Jul 03 2015
    

Formula

a(n) = floor(n*log(n)/log(2)) + 1.
a(n) = A070939(A000312(n)). - Michel Marcus, Jul 03 2015

A258371 Triangle read by rows: T(n,k) is number of ways of arranging n indistinguishable points on an n X n square grid such that k rows contain at least one point.

Original entry on oeis.org

1, 2, 4, 3, 54, 27, 4, 408, 1152, 256, 5, 2500, 22500, 25000, 3125, 6, 13830, 315900, 988200, 583200, 46656, 7, 72030, 3709545, 25882780, 40588905, 14823774, 823543, 8, 360304, 39024384, 535754240, 1766195200, 1657012224, 411041792, 16777216
Offset: 1

Author

Adam J.T. Partridge, May 28 2015

Keywords

Comments

Row sums give A014062, n >= 1.
Leading diagonal is A000312, n >= 1.
The triangle t(n,k) = T(n,k)/binomial(n,k) gives the number of ways to place n stones into the k X n grid of squares such that each of the k rows contains at least one stone. See A259051. One can use a partition array for this (and the T(n,k)) problem. See A258152. - Wolfdieter Lang, Jun 17 2015

Examples

			The number of ways of arranging eight pawns on a standard chessboard such that two rows contain at least one pawn is T(8,2)=360304.
Triangle T(n,k) begins:
n\k 1      2        3       4        5       6 ...
1:  1
2:  2      4
3:  3     54      27
4:  4    408    1152      256
5:  5   2500   22500    25000     3125
6:  6  13830  315900   988200   583200   46656
...
n = 7:  7  72030 3709545 25882780  40588905 14823774 823543,
n = 8:  8 360304 39024384 535754240 1766195200 1657012224 411041792 16777216.
		

Crossrefs

Programs

  • Mathematica
    T[n_,k_]:= Binomial[n,k] * Sum[Multinomial@@ (Last/@ Tally[e]) * Times@@ Binomial[n,e], {e, IntegerPartitions[n, {k}]}]; Flatten@ Table[ T[n,k],{n,9}, {k,n}] (* Giovanni Resta, May 28 2015 *)

Formula

T(n,2) = binomial(n,2)*(binomial(2*n,n)-2). - Giovanni Resta, May 28 2015

A258103 Number of pandigital squares (containing each digit exactly once) in base n.

Original entry on oeis.org

0, 0, 1, 0, 1, 3, 4, 26, 87, 47, 87, 0, 547, 1303, 3402, 0, 24192, 187562
Offset: 2

Author

Adam J.T. Partridge, May 20 2015

Keywords

Comments

For n = 18, the smallest and largest pandigital squares are 2200667320658951859841 and 39207739576969100808801. For n = 19, they are 104753558229986901966129 and 1972312183619434816475625. For n = 20, they are 5272187100814113874556176 and 104566626183621314286288961. - Chai Wah Wu, May 20 2015
When n is even, (n-1) is a factor of the pandigital squares. When n is odd, (n-1)/2 is a factor with the remaining factors being odd. Therefore, when n is odd and (n-1)/2 has an odd number of 2s as prime factors there are no pandigital squares in base n (e.g. 5, 13, 17 and 21). - Adam J.T. Partridge, May 21 2015
If n is odd and (n-1)/2 has an odd 2-adic valuation, then there are no squares in base n using all the digits from 1 to n-1 once, or all the digits from 0 to n-2 once or all the digits from 1 to n-2 once. This can be proved using the same argument as in the linked blogposts. - Chai Wah Wu, Feb 25 2024

Examples

			For n=4 there is one pandigital square, 3201_4 = 225 = 15^2.
For n=6 there is one pandigital square, 452013_6 = 38025 = 195^2.
For n=10 there are 87 pandigital squares (A036745).
There are no pandigital squares in bases 2, 3, 5 or 13.
Hexadecimal has 3402 pandigital squares, the largest is FED5B39A42706C81.
		

Crossrefs

Programs

  • PARI
    a(n) = if(n%2==1 && valuation(n-1,2)%2==0, 0, my(lim=sqrtint(n^n - (n^n-n)/(n-1)^2), count=0); for(m=sqrtint((n^n-n)/(n-1)^2 + n^(n-2)*(n-1) - 1), lim, if(#Set(digits(m^2,n))==n, count++)); count) \\ Jianing Song, Feb 23 2024. Note that the searching range for m is [sqrt(A049363(n)), sqrt(A062813(n))]
  • Python
    from gmpy2 import isqrt, mpz, digits
    def A258103(n): # requires 2 <= n <= 62
        c, sm, sq = 0, mpz(''.join([digits(i, n) for i in range(n-1, -1, -1)]), n), mpz(''.join(['1', '0']+[digits(i, n) for i in range(2, n)]), n)
        m = isqrt(sq)
        sq = m*m
        m = 2*m+1
        while sq <= sm:
            if len(set(digits(sq, n))) == n:
                c += 1
            sq += m
            m += 2
        return c # Chai Wah Wu, May 20 2015
    

Extensions

a(17)-a(19) from Giovanni Resta, May 20 2015