William Riley Barker has authored 2 sequences.
A360222
a(n) is the number of permutable pieces in a standard n X n X n Rubik's cube.
Original entry on oeis.org
0, 8, 20, 56, 92, 152, 212, 296, 380, 488, 596, 728, 860, 1016, 1172, 1352, 1532, 1736, 1940, 2168, 2396, 2648, 2900, 3176, 3452, 3752, 4052, 4376, 4700, 5048, 5396, 5768, 6140, 6536, 6932, 7352, 7772, 8216, 8660, 9128, 9596, 10088, 10580, 11096, 11612, 12152
Offset: 1
The 2 X 2 X 2 Rubik's cube consists of 8 corner pieces, so a(2) = 8; the 3 X 3 X 3 cube has 8 corner pieces, 12 edge pieces, and 6 non-permutable center pieces, so a(3) = 8 + 12 = 20.
-
A360222[n_] := If[n == 1, 0, 6*((n-2)*n - Mod[n, 2]) + 8]; Array[A360222, 50] (* or *)
LinearRecurrence[{2, 0, -2, 1}, {0, 8, 20, 56, 92}, 50] (* Paolo Xausa, Oct 04 2024 *)
-
N = 20
seq = [0]
for n in range(2, N+1):
seq.append( 8 + 12*(n-2) + 6*((n-2)**2 - (n%2)) )
A350574
Primes p such that p, asc(p), and desc(p) are all distinct primes (where asc(p) and desc(p) are the digits of p in ascending and descending order, respectively) and p is the minimum of all permutations of its digits with this property.
Original entry on oeis.org
131, 197, 373, 419, 571, 593, 617, 839, 919, 1297, 1327, 1429, 1879, 1949, 1993, 2129, 2213, 2591, 3539, 4337, 4637, 4639, 5519, 6619, 8389, 8933, 11491, 11519, 11527, 11597, 11897, 11969, 12757, 12829, 12979, 13649, 13879, 14537, 14737, 14741, 14891
Offset: 1
131 is prime, and so are asc(131) = 113 and desc(131) = 311. Further, these are all distinct primes.
419, asc(419) = 149, and desc(419) = 941 are all distinct primes, and 419 is the smallest permutation of the digits {1,4,9} with this property (149 is not included because asc(149) = 149, so these would not be distinct; 491 is not included because 419 < 491 with the same set of digits).
-
d:= n-> convert(n, base, 10):
g:= (n, r)-> parse(cat(sort(d(n), r)[])):
f:= n-> (s-> nops(s)=3 and andmap(isprime, s))({n, g(n, `<`), g(n, `>`)}):
q:= n-> f(n) and n=min(select(f, map(x-> parse(cat(x[])),
combinat[permute](d(n))))):
select(q, [$1..15000])[]; # Alois P. Heinz, Jan 15 2022
-
Select[Prime@Range@2000,AllTrue[FromDigits/@{s=Sort[d=IntegerDigits@#],Reverse@s},PrimeQ]&&Min@Most@Rest@Sort@Select[FromDigits/@Permutations[d],PrimeQ]==#&] (* Giorgos Kalogeropoulos, Jan 16 2022 *)
-
import numpy as np
# preliminary functions we will use in building our list
def is_prime(n):
for d in range(2,int(np.sqrt(n))+1):
if n % d == 0:
return False
return True
def asc(n): # returns integer with digits of n in ascending order
n_list = [int(digit) for digit in str(n)] # separate digits of n into a list
n_list.sort() # rearrange numbers in ascending order
asc_n = int(''.join([str(digit) for digit in n_list])) # concatenate the sorted digits
return asc_n
def desc(n): # returns integer with digits of n in descending order
n_list = [int(digit) for digit in str(n)]
n_list.sort(reverse=True)
desc_n = int(''.join([str(digit) for digit in n_list]))
return desc_n
N = 5
# get list of integers n such that n, asc(n), and desc(n) are all distinct primes
condition_1 = [n for n in range(2,10**N)
if is_prime(n)
and is_prime(asc(n))
and is_prime(desc(n))
and n not in (asc(n),desc(n))]
# refine so that our list includes only the minimum permutation of a given set of digits satisfying condition 1
condition_2 = []
for num in condition_1:
if asc(num) not in [asc(n) for n in condition_2]:
condition_2.append(num)
print(condition_2)
-
from itertools import count, islice, combinations_with_replacement
from sympy import isprime
from sympy.utilities.iterables import multiset_permutations
def A350574_gen(): # generator of terms
for l in count(1):
rlist = []
for a in combinations_with_replacement('123456789',l):
s = ''.join(a)
p, q = int(s), int(s[::-1])
if p != q and isprime(p) and isprime(q):
for b in multiset_permutations(a):
r = int(''.join(b))
if p < r < q and isprime(r):
rlist.append(r)
break
yield from sorted(rlist)
A350574_list = list(islice(A350574_gen(),50)) # Chai Wah Wu, Feb 13 2022
Comments