Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.

2 added 187 characters in body

# TI-Basic, 45 bytes

Input N
For(B,2,N
If prod(seq(BfPart(iPart(N/B^X)/B),X,0,log(N)/log(B))<2
Disp B
End


## Explanation

• Input N
• For every B from 2 to N
• If N is just 0 and 1 in base B
• Display B
• End loop

## The complicated part

The second line works as follows:

• For every X from 0 to logB N
• B × fPart(iPart(N / BX) / B) is the Nth digit in base B, counting backwards
• Consider this as a list
• For each element, if the digit is less than 2, yield 1 (true), else 0 (false)
• Take the product: 1 iff all elements are 1

## Note

The program runs significantly faster if a closing parenthesis ) is placed at the end of the second line. See here for more about this.

# TI-Basic, 45 bytes

Input N
For(B,2,N
If prod(seq(BfPart(iPart(N/B^X)/B),X,0,log(N)/log(B))<2
Disp B
End


## Explanation

• Input N
• For every B from 2 to N
• If N is just 0 and 1 in base B
• Display B
• End loop

## The complicated part

The second line works as follows:

• For every X from 0 to logB N
• B × fPart(iPart(N / BX) / B) is the Nth digit in base B, counting backwards
• Consider this as a list
• For each element, if the digit is less than 2, yield 1 (true), else 0 (false)
• Take the product: 1 iff all elements are 1

# TI-Basic, 45 bytes

Input N
For(B,2,N
If prod(seq(BfPart(iPart(N/B^X)/B),X,0,log(N)/log(B))<2
Disp B
End


## Explanation

• Input N
• For every B from 2 to N
• If N is just 0 and 1 in base B
• Display B
• End loop

## The complicated part

The second line works as follows:

• For every X from 0 to logB N
• B × fPart(iPart(N / BX) / B) is the Nth digit in base B, counting backwards
• Consider this as a list
• For each element, if the digit is less than 2, yield 1 (true), else 0 (false)
• Take the product: 1 iff all elements are 1

## Note

The program runs significantly faster if a closing parenthesis ) is placed at the end of the second line. See here for more about this.

1

# TI-Basic, 45 bytes

Input N
For(B,2,N
If prod(seq(BfPart(iPart(N/B^X)/B),X,0,log(N)/log(B))<2
Disp B
End


## Explanation

• Input N
• For every B from 2 to N
• If N is just 0 and 1 in base B
• Display B
• End loop

## The complicated part

The second line works as follows:

• For every X from 0 to logB N
• B × fPart(iPart(N / BX) / B) is the Nth digit in base B, counting backwards
• Consider this as a list
• For each element, if the digit is less than 2, yield 1 (true), else 0 (false)
• Take the product: 1 iff all elements are 1